To Bipartite

template<class G>
class ToBipartite

Public Functions

inline ToBipartite(const G &g)
inline bool isBipartite() const
inline int component(const int v) const

Returns the component (0 or 1) in which the vertex v is in.

Private Functions

inline void explore(const G &g, const int v, const int component)

Private Members

std::vector<int> m_states
bool m_isBipartite