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 | |
#for a 14 node network with connections as below. Each tuple represents a connected edge | |
edge_list = [(1, 2),(1,3),(1,8),(2,3),(2,4),(3,6),(4,5),(4,11),(5,6),(5,7),(6,10),(6,14),(7,8),(8,9),(9,10),(9,12),(9,13),(11,12),(11,13),(12,14),(14,13)] | |
G = nx.Graph() #to create the graph structure with unidirectional edges | |
#Use the below DiGraph() for bi-directional edges | |
# G = nx.DiGraph() |