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

Solutions.P85

Description

Some solutions to Problems.P85 of Ninety-Nine Haskell Problems.

Synopsis

Documentation

isomorphic :: G -> G -> Bool Source #

Determine whether two graphs are isomorphic.

Builds up a bijection from a starting vertex to its neighbors, expanding until it encounters an inconsistency or until there are no more vertexes to expand to.

isomorphic' :: G -> G -> Bool Source #

Determine whether two graphs are isomorphic.

This tests all bijections of vertexes from one graph to another to see if any are identical.

isomorphic'' :: G -> G -> Bool Source #

Determine whether two graphs are isomorphic.

Tests bijections which are limited to matching vertexes with the same degree, and looks for any which results in one graph becoming identical to the other.