s***i 发帖数: 49 | 1 How can I give algorithm that checks whether a graph is bipartite (a graph
whose nodes can be divided into two sets N1 and N2, and every edge is
between a member of N1 and N2)?
And since non-bipartite means there must be a cycle of odd length, how can I
check bipartite, and if false, prints a cycle of odd length?
Thanks in advance. | s******e 发帖数: 285 | 2 DFS
I
【在 s***i 的大作中提到】 : How can I give algorithm that checks whether a graph is bipartite (a graph : whose nodes can be divided into two sets N1 and N2, and every edge is : between a member of N1 and N2)? : And since non-bipartite means there must be a cycle of odd length, how can I : check bipartite, and if false, prints a cycle of odd length? : Thanks in advance.
|
|