How to represent connected components? Dr. Arne Babenhauserheide (03 Sep 2023 11:11 UTC)
Re: How to represent connected components? John Cowan (03 Sep 2023 15:20 UTC)
Re: How to represent connected components? Arthur A. Gleckler (03 Sep 2023 16:29 UTC)
Re: How to represent connected components? Jakob Wuhrer (03 Sep 2023 19:27 UTC)
Re: How to represent connected components? Dr. Arne Babenhauserheide (04 Sep 2023 08:26 UTC)

How to represent connected components? Dr. Arne Babenhauserheide 03 Sep 2023 11:00 UTC
Hello,

one topic that came up in the discussion about finishing topological
sorting is to provide a way to calculate the strongly connected
components.

How should we represent these?

To make the question concrete:

A test built from the task in Rosetta Code for Kosarajus and Tarjans
algorithm (https://rosettacode.org/wiki/Kosaraju) could look like this:

(test-equal
    '(0 0 0 3 3 5 5 7)
  (connected-components
   (edgelist->graph '((0 1)
                      (1 2)
                      (2 0)
                      (3 1) (3 2) (3 4)
                      (4 3) (4 5)
                      (5 2) (5 6)
                      (6 5)
                      (7 4) (7 6) (7 7)))))

What would you expect to see as output?

Is '(0 0 0 3 3 5 5 7) understandable?

Should we provide bags of elements instead? '(0 1 2)(3 4)(5 6)(7)

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de