Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • graph-tool graph-tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

For questions about how to compile, install or use the library, please use instead the mailing list at https://graph-tool.skewed.de/mailing
(If unsure, use the mailing list first.)



When opening new issues, please choose the BUG template from the drop-down menu, and fill out the required information.

  • Tiago Peixoto
  • graph-toolgraph-tool
  • Issues
  • #90
Closed
Open
Created Aug 06, 2014 by Tiago Peixoto@count0Owner

Faster adding of vertices

A manner to add vertices from an adj_list should be added to increase performance, since the for loop needed to add multiple vertices at a time using the python interface is slow.

An idea could be to generate a dot file and then upload it. I did that using networkx (generating a xml file) but there is not much gain in the vertex adding issue...

import graph_tool.all as gt

import networkx as nx

def nx_2_gt(g):

    """ Adds vertices in a faster way using gt """

    q=nx.DiGraph()

    q.add_nodes_from(g.nodes_iter())

    q.add_edges_from(g.edges_iter())

    nx.write_graphml(q,'./dummy.xml')

    g=gt.load_graph('./dummy.xml')

    os.remove('./dummy.xml')
Assignee
Assign to
Time tracking