aysylu/loom

maximal-cliques silently breaks on digraphs

flodiebold opened this issue · 0 comments

E.g.

user> (graph-alg/maximal-cliques (graph/digraph ["a" "b"] ["b" "c"]))
(#{"a" "b"} #{"c"})
user> (graph-alg/maximal-cliques (graph/digraph ["c" "b"] ["b" "a"]))
(#{"a"})

(these graphs are isomorphic.)

Of course Bron-Kerbosch only works on undirected graphs, but silently giving wrong results doesn't seem like the right thing to do here 😄 It'd be nice if it could either work on only the edges that go in both directions (which was what I assumed it would do), or loudly fail, or at least say in the documentation that it won't work.

(Or maybe I have some fundamental misunderstanding here?)