https://gist.githubusercontent.com/rdm/3ce3503ee63b51cd49c97ad185e1dd6f/raw/100e83ba7a87f10b844271180318c37fee1304dc/gph.txt

The text at that gist represents a "defective graph"

require'web/gethttp'
text=: gethttp url
'A B C'=: |:640 #.inv<.0".text rplc LF,' '

part1=: A=/B
part2=: B=/C

To get an idea of the structure, try inspecting part1 and part2 in viewmat.

part1 and part2 are almost the same, but not quite. In some cases, we
have nodes which are reflexive (point to themselves) in the one, but
not in the other.

Also, some nodes point "outside" the graph. In part1 and part2, these
connections are ignored, and that's fine for now.

I am trying to figure out a good way of detecting nontrivial cycles
(cycles which include at least two graph nodes) in either part 1, or
part 2, or the combination of the two (part1 and part2 together
represent connections involving these same nodes).

Does anyone here have a good approach for that?

Thanks,
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to