bipartite_check
Checks whether an undirected graph is bipartite (2-colorable) and returns the two vertex sets or an odd cycle.
Instructions
Check whether an undirected graph is bipartite (2-colorable). Returns the two vertex sets if bipartite, or an odd cycle if not.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edges | Yes | Undirected edges as [u, v] pairs | |
| vertices | Yes | Number of vertices (0-indexed) |