Coder Social home page Coder Social logo

Comments (3)

szhorvat avatar szhorvat commented on June 9, 2024

Can you make the example complete? We don't have the data files that you are loading.

Ideally, make an example that does not rely on any data files. If not possible, please provide the data files.

from python-igraph.

amwps290 avatar amwps290 commented on June 9, 2024

@szhorvat
the pgp.xml download from https://networks.skewed.de/net/pgp_strong/files/pgp_strong.xml.zst,
the escorts download from https://networks.skewed.de/net/escorts/files/escorts.xml.zst.

#!/bin/env python

from igraph import *
import graph_tool.all as gt
import timeit

gt1 = gt.load_graph("pgp.xml")
ut1 = gt.load_graph("escorts.xml")



g = Graph.from_graph_tool(gt1)
u = Graph.from_graph_tool(ut1)

if __name__ == "__main__":

    print("Profiling shortest path")
    print("=======================")
    print()

    n=1000
    print(timeit.timeit("u.shortest_paths([u.vs[0]])", setup="from __main__ import u", number=n)/n)

    print()
    print("Profiling clustering")
    print("==================")
    print()

    n=100
    print(timeit.timeit("u.transitivity_undirected()", setup="from __main__ import u", number=n)/n)

    print()
    print("Profiling PageRank")
    print("==================")
    print()

    n=100
    print(timeit.timeit("g.pagerank(damping=0.85)", setup="from __main__ import g", number=n)/n)

    print()
    print("Profiling k-core")
    print("================")
    print()

    n=1000
    print(timeit.timeit("u.coreness(mode='all')", setup="from __main__ import u", number=n)/n)


    print()
    print("Profiling minimum spanning tree")
    print("===============================")
    print()

    n=1000
    print(timeit.timeit("u.spanning_tree()", setup="from __main__ import u", number=n)/n)

    print()
    print("Profiling betweenness")
    print("=====================")
    print()

    n=3
    print(timeit.timeit("g.betweenness()", setup="from __main__ import g", number=n)/n)
    print(timeit.timeit("g.edge_betweenness()", setup="from __main__ import g", number=n)/n)

from python-igraph.

ntamas avatar ntamas commented on June 9, 2024

I'll take a look, stay tuned.

from python-igraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.