For all other vertices, the color is unassigned. Also, initialize a boolean variable b as True. This variable will be used to check if the graph is bipartite or not.
\[
w_{1} :=\operatorname{Red}
\]
\[
\text{for } i :=2 \text{ to } n
\]
\[
w_{i} :=
Show more…