1. Definition
Bipartite Graphs: a graph whose nodes can be split into two sets L and R and every edge connects an node in L with a node in R .
2.Code in python
Build a bipartite graph:
from networkX.algorithms import bipartite
B = nx.Graph() //No separate class for bipartite graphs
B.add_nodes_from(['A','B','C','D','E'],bipartite=0) //label one set of nodes 0
B.add_nodes_from([1,2,3,4],bipartite=1) //label other set of nodes 1
B.add_edges_from([('A',1),('B',1),('C',1),('C',3),('D',2),('E',3),('E',4)])
Fountions:
//Checking if a graph is bipartite
bipartite.is_bipartite(B)