To print: File -> Print Preview
In [1]:
%pylab inline
import networkx as nx
Assign your name to a variable called "my_name".
Assign your student id to variable "stud_id".
Use variable "my_name" and "stud_id" to print your name and your student id using "print" function in the following format.
Your Name - Your Student ID
For example:
Ali bin Abu - 2013123456
In [ ]:
Import APGG, generate an undirected graph G using the "stud_id" variable defined in Q1 and draw it using APGG.draw() function.
Hint: Click on "Cell > Run All" if you get a warning message.
In [ ]:
List all vertices of graph G and their respective degree.
In [ ]:
List all edges along with its weight.
In [ ]:
Determine whether graph G is an Eulerian graph. (NetworkX Reference, pg. 256)
In [ ]:
In [ ]:
What is the total weight for the path choses in Q6. (NetworkX Reference, pg. 328)
In [ ]:
Find a maximal cardinality matching in graph G. (NetworkX Reference, pg. 309)
In [ ]:
Find a minimum spanning tree of the undirected weighted graph G. (NetworkX Reference, pg. 315)
In [ ]:
Generate an undirected graph K using your friend's student id and check if K is isomorphic with G. (NetworkX Reference, pg. 285)
In [ ]:
Generate a network L using your student id using APGG.generate_flow() function and draw it.
In [ ]:
Find a maximum single-commodity flow for network L from 's' to 't'. (NetworkX Reference, pg. 259)
In [ ]:
flow_value, flow_dict =
Print flow_value
In [ ]:
Print flow_dict
In [ ]:
Compute the value and the node partition of a minimum (s, t)-cut. (NetworkX Reference, pg. 261)
In [ ]:
cut_value, cut_set =
Print cut_set
In [ ]:
Print cut_value
In [ ]: