public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] graphds: Fix description of SCC algorithm
@ 2022-07-22 10:09 Richard Sandiford
  2022-07-22 10:49 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2022-07-22 10:09 UTC (permalink / raw)
  To: gcc-patches

graphds_scc says that it uses Tarjan's algorithm, but it looks like
it uses Kosaraju's algorithm instead (dfs one way followed by dfs
the other way).

OK to install?

Richard


gcc/
	* graphds.cc (graphds_scc): Fix algorithm attribution.
---
 gcc/graphds.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/graphds.cc b/gcc/graphds.cc
index f4c83e81cf9..91a2ca5c225 100644
--- a/gcc/graphds.cc
+++ b/gcc/graphds.cc
@@ -276,7 +276,7 @@ graphds_dfs (struct graph *g, int *qs, int nq, vec<int> *qt,
 }
 
 /* Determines the strongly connected components of G, using the algorithm of
-   Tarjan -- first determine the postorder dfs numbering in reversed graph,
+   Kosaraju -- first determine the postorder dfs numbering in reversed graph,
    then run the dfs on the original graph in the order given by decreasing
    numbers assigned by the previous pass.  If SUBGRAPH is not NULL, it
    specifies the subgraph of G whose strongly connected components we want
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] graphds: Fix description of SCC algorithm
  2022-07-22 10:09 [PATCH] graphds: Fix description of SCC algorithm Richard Sandiford
@ 2022-07-22 10:49 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2022-07-22 10:49 UTC (permalink / raw)
  To: Richard Sandiford, GCC Patches

On Fri, Jul 22, 2022 at 12:10 PM Richard Sandiford via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> graphds_scc says that it uses Tarjan's algorithm, but it looks like
> it uses Kosaraju's algorithm instead (dfs one way followed by dfs
> the other way).
>
> OK to install?

OK.

> Richard
>
>
> gcc/
>         * graphds.cc (graphds_scc): Fix algorithm attribution.
> ---
>  gcc/graphds.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/graphds.cc b/gcc/graphds.cc
> index f4c83e81cf9..91a2ca5c225 100644
> --- a/gcc/graphds.cc
> +++ b/gcc/graphds.cc
> @@ -276,7 +276,7 @@ graphds_dfs (struct graph *g, int *qs, int nq, vec<int> *qt,
>  }
>
>  /* Determines the strongly connected components of G, using the algorithm of
> -   Tarjan -- first determine the postorder dfs numbering in reversed graph,
> +   Kosaraju -- first determine the postorder dfs numbering in reversed graph,
>     then run the dfs on the original graph in the order given by decreasing
>     numbers assigned by the previous pass.  If SUBGRAPH is not NULL, it
>     specifies the subgraph of G whose strongly connected components we want
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-22 10:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22 10:09 [PATCH] graphds: Fix description of SCC algorithm Richard Sandiford
2022-07-22 10:49 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).