A graph G with n nodes is biparatite. If it contains
A graph G with n nodes is biparatite. If it contains no cycle of odd length.
A cycle is a path with the same first and last vertex. The length of the cycle is the number of edges that it contains, and a cycle is odd if it contains an odd number of edges. A cycle with an odd number of vertices is called an odd cycle.
A bipartite graph is a graph whose vertices can be divided into two disjoint sets U and V such that every edge connects a vertex in U to one in V; that is, U and V are independent sets.
A graph is an abstract data type that is meant to implement the undirected graph and directed graph concepts from mathematics; specifically, the field of graph theory. The vertices may be part of the graph structure, or may be external entities represented by integer indices or references.