From 3263af213d170290f3742946186834a1fd492128 Mon Sep 17 00:00:00 2001 From: tiwavaldese Date: Wed, 8 Nov 2023 17:09:22 +0100 Subject: [PATCH 1/3] nx_pull_requests.txt --- 2023-round-2/tiwavaldese/nx_pull_requests.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/2023-round-2/tiwavaldese/nx_pull_requests.txt b/2023-round-2/tiwavaldese/nx_pull_requests.txt index 862718a..261b9fa 100644 --- a/2023-round-2/tiwavaldese/nx_pull_requests.txt +++ b/2023-round-2/tiwavaldese/nx_pull_requests.txt @@ -1 +1,3 @@ https://github.com/networkx/outreachy/pull/251 + +https://github.com/networkx/outreachy/pull/257 \ No newline at end of file From df138b46cd7ff8eb2c4704088a3e70567c3e6b10 Mon Sep 17 00:00:00 2001 From: tiwavaldese Date: Wed, 8 Nov 2023 17:10:40 +0100 Subject: [PATCH 2/3] nx_tutorial_script.py --- .../tiwavaldese/nx_tutorial_script.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 2023-round-2/tiwavaldese/nx_tutorial_script.py diff --git a/2023-round-2/tiwavaldese/nx_tutorial_script.py b/2023-round-2/tiwavaldese/nx_tutorial_script.py new file mode 100644 index 0000000..dedb28e --- /dev/null +++ b/2023-round-2/tiwavaldese/nx_tutorial_script.py @@ -0,0 +1,29 @@ +import networkx as nx +import matplotlib.pyplot as plt + +#Create a DiGraph graph object +G = nx.DiGraph() + +#Add multiple nodes of different types +G.add_node(1) +G.add_nodes_from([2,3]) +G.add_node(4) +G.add_node(5) +G.add_node(6) +G.add_nodes_from("spam") + +#Add multiple edges between nodes +G.add_edge(1,'s') +G.add_edge('s',(2,3)) +G.add_edge(4,'p') +G.add_edge(5,'s') +G.add_edge('p','a') +G.add_edge('a',6) +G.add_edge(1,'m') + +# Find the shortest path and print +st_p = nx.shortest_path(G) +print(st_p) + +# Plot the Graph +nx.draw(G, with_labels = True, connectionstyle='arc3, rad = 0.1') From 281c16bb738161bf344a1c336eeb595709868145 Mon Sep 17 00:00:00 2001 From: tiwavaldese Date: Thu, 9 Nov 2023 13:21:48 +0100 Subject: [PATCH 3/3] nx_tutorial_script.py --- .../tiwavaldese/nx_tutorial_script.py | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/2023-round-2/tiwavaldese/nx_tutorial_script.py b/2023-round-2/tiwavaldese/nx_tutorial_script.py index dedb28e..3373dcd 100644 --- a/2023-round-2/tiwavaldese/nx_tutorial_script.py +++ b/2023-round-2/tiwavaldese/nx_tutorial_script.py @@ -13,17 +13,29 @@ G.add_nodes_from("spam") #Add multiple edges between nodes -G.add_edge(1,'s') -G.add_edge('s',(2,3)) -G.add_edge(4,'p') -G.add_edge(5,'s') -G.add_edge('p','a') +G.add_edge(1,(2,3)) +G.add_edge((2,3),1) +G.add_edge(1,3) +G.add_edge(3,1) +G.add_edge((2,3),5) +G.add_edge(5,(2,3)) +G.add_edge((2,3),6) +G.add_edge(6,(2,3)) +G.add_edge(4,5) +G.add_edge(5,4) +G.add_edge(4,'s') +G.add_edge('s',4) +G.add_edge(5,'p') +G.add_edge('p',5) G.add_edge('a',6) -G.add_edge(1,'m') +G.add_edge(6,'a') +G.add_edge(2,'m') +G.add_edge('m',2) # Find the shortest path and print st_p = nx.shortest_path(G) print(st_p) # Plot the Graph -nx.draw(G, with_labels = True, connectionstyle='arc3, rad = 0.1') +nx.draw(G, with_labels = True, node_color= 'red') +plt.show() \ No newline at end of file