Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tags: sjl/cl-digraph

Tags

v1.6.0

Toggle v1.6.0's commit message
Add convenience builders and graphviz label override

v1.5.0

Toggle v1.5.0's commit message
Merge

v1.4.0

Toggle v1.4.0's commit message
Add an explicit condition hierarchy

Fixes #5

v1.3.2

Toggle v1.3.2's commit message
Detect *all* cycles during topological sort

Previously the cycle detection was limited to detecting when we hit
a currently-being-visited node during a traversal.  So something like this would
be correctly found:

    A --> B --> C
          ^     |
          |     |
          +-----+

We start at the root (A), go to B, then to C, then to B, and detect that we're
still working on B and signal the error.

But this doesn't find all cycles, because we *start* at the root nodes, and if
a cycle doesn't have any outcropping branches we'll never reach it at all.  For
example:

    A --> B
    ^     |
    |     |
    +-----+

This graph has no roots, so we incorrectly ignore the cycle.

This patch fixes the problem by keeping a count of visited nodes and and making
sure it matches the digraph's size at the end.

Fixes #4

v1.3.1

Toggle v1.3.1's commit message
Bump version, update changelog

v1.3.0

Toggle v1.3.0's commit message
Add `arbitrary-vertex`

v1.2.1

Toggle v1.2.1's commit message
Make copy-digraph actually copy the data

v1.2.0

Toggle v1.2.0's commit message
Bump version

v1.1.0

Toggle v1.1.0's commit message
Bump version & changelog

v1.0.0

Toggle v1.0.0's commit message
Add `emptyp`, export `roots` and `leafs`