[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    tsort(1) -l (longest cycle) clarification
From:       Fernando_ApesteguĂ­a <fernando.apesteguia () gmail ! com>
Date:       2020-07-23 9:55:59
Message-ID: CAGwOe2Yrnidv5LCho1K8Cz+UEOzonHXQbVt9snexn3B9Rmz0iQ () mail ! gmail ! com
[Download RAW message or body]

Hi there,

I'm having some doubts about the -l flag in tsort(1). According to the
man page, it should show the longest cycle in the graph. Assuming we
have a file called graph with the following contents:

A B
A D
B C
C A
D E
E F
F E

This graph has two cycles one involving two nodes and the other
involving three nodes:

$ tsort graph
tsort: cycle in data
tsort: E
tsort: F
F
tsort: cycle in data
tsort: A
tsort: B
tsort: C
C
A
D
B
E

When using -q, tsort(1) does not show information about cycles as expected:

$ tsort -q graph
F
C
A
D
B
E

Using -l shows the exact same output as not using options at all:

$ tsort -l graph
tsort: cycle in data
tsort: E
tsort: F
F
tsort: cycle in data
tsort: A
tsort: B
tsort: C
C
A
D
B
E

So what's -l supposed to do? Shouldn't it at least mark one of the
cycles and say "This one is the longest"? Technically, it shows the
longest cycle, but it shows other cycles as well so I don't see the
use of this.

Cheers
_______________________________________________
freebsd-hackers@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic