ninetynine-1.3.0: Ninety-Nine Haskell Problems
CopyrightCopyright (C) 2021 Yoo Chung
LicenseGPL-3.0-or-later
Maintainerdev@chungyc.org
Safe HaskellSafe-Inferred
LanguageGHC2021

Problems.P89

Description

Part of Ninety-Nine Haskell Problems. Some solutions are in Solutions.P88.

Synopsis

Documentation

bipartite :: G -> Bool Source #

Write a function that finds out whether a given graph is bipartite.

Examples

>>> bipartite $ toG $ Paths [[1,2,3,4],[1,4,5,2]]
True
>>> bipartite $ toG $ Paths [[1,2,3,4],[1,4,5,2],[1,3]]
False