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 | |
import sys | |
g = nx.Graph() | |
for i in range(6): | |
g.add_node(i+1) | |
if (i+1) > 1: | |
g.add_edge(i+1,i) | |
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 | |
import matplotlib as mat | |
import matplotlib.pyplot as plt | |
import numpy as np | |
# Colors each node in the given graph based on the data | |
# Set provided | |
def color_graph(graph, d, cmap): | |
col_graph = nx.Graph() | |