2colorable
2colorable is a term used in graph theory to describe graphs that can be colored with two colors so that adjacent vertices have different colors. A graph with this property is called 2-colorable or bipartite. Equivalently, the vertex set can be divided into two independent sets, so no edge has both endpoints in the same set.
A key characterization is that a graph is 2-colorable if and only if it contains no odd
A standard method to determine 2-colorability is a BFS or DFS that attempts to assign colors while
Examples illustrate the concept: a path graph and any even cycle are 2-colorable, while a triangle (a
Applications of 2-colorability include scheduling with two time slots, parity constraint systems, and recognizing bipartite structures