This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import networkx as nx | |
def nx2gt(nxG): | |
""" | |
Converts a networkx graph to a graph-tool graph. | |
""" | |
# Phase 0: Create a directed or undirected graph-tool Graph | |
import graph_tool as gt | |
gtG = gt.Graph(directed=nxG.is_directed()) |