Given two directed acyclic graphs $G_1$ and $G_2$, and their roots $r_1$ and $r_2$, is there a polynomial algorithm to determine if $G_1$ and $G_2$ are isomorphic?
-
$\begingroup$ Wikipedia says this problem is GI-complete, that is, that GI problems can be reduced to DAGI problems in polynomial time. $\endgroup$– user44191Commented Feb 26, 2019 at 23:47
-
$\begingroup$ Link for reference in the comment by @user44191 : en.wikipedia.org/wiki/… And, to spell it out: if rooted DAG isomorphism was a polynomial-time problem, then Graph Isomorphism would be in P, and we would have solved a famous open problem: Graph Isomorphism ...is not known to be solvable in polynomial time nor to be NP-complete, and therefore may be in the computational complexity class NP-intermediate. $\endgroup$– David Roberts ♦Commented Feb 26, 2019 at 23:48
-
$\begingroup$ Thanks a lot! so what's the best algorithm so far, if I assign each node a label, is the problem becomes simpler? $\endgroup$– user92158Commented Feb 26, 2019 at 23:57
-
$\begingroup$ What is meant by the root of a graph? $\endgroup$– Gerry MyersonCommented May 23 at 1:13
-
1$\begingroup$ @GerryMyerson A node (necessarily of in-degree $0$, in a dag) from which every node is reachable by a directed path. $\endgroup$– Emil JeřábekCommented Jun 21 at 18:52
1 Answer
For arbitrary graphs, no there is no known polytime algorithm, proving that DAGI (Directed Acyclic Graph Isomorphism) is GI-complete is rather straightforward.
First, let us consider that GI isomorphism restricted to non-trivial connected undirected graph is GI-complete Then, given $G = (V, E)$ a non-trivial connected undirected graph, we can convert it in polytime into a DAG $D = (V\uplus E, F)$ and $F = \{(\{u, v\}, v)\mid\{u, v\}\in E\}$.
If one explicitly needs a rooted DAG, then, $D_{\texttt{rooted}} = (V\uplus E\uplus\{r\}, F_{\texttt{rooted}}, r)$ where $r$ is a fresh vertex, and $F_{\texttt{rooted}} = F \uplus \{(r, \{u, v\}) \mid\{u, v\}\in E\}$
(Note that $D$ has the edges of $G$ points toward its vertices, the other construction is perfectly legit as well)
Note that the hard part of the proof is then to prove that there exists an isomorphism in $D$ iff there exists an isomorphism in $G$. Note that if $G$ is simple, then $D$ is simple. Then, assuming $\sigma$ an isomorphism between $G_1$ and $G_2$, one can easily prove that there exist an isomorphism $\sigma'$ between $D_1$ and $D_2$. Conversely, assuming an isomorphism $\sigma'$ between $D_1$ and $D_2$, one can easily prove that there exist an isomorphism between $G_1$ and $G_2$ by (i) proving that nodes and edges in $G_1$ are respectively mapped to nodes and edges in $G_2$ through $\sigma'$. Then define $\sigma$ as $\sigma'$ while simply ignoring edges.
Hence, given an instance of GI (that is, a pair of graphs $G_1$ and $G_2$ to be tested for isomorphism) we can reduce it an instance of DAGI.
-
$\begingroup$ I don't understand the reduction. Since $G$ is an undirected graph, $E$ is a set of unordered pairs, thus each element $\{u,v\}\in E$ is in the resulting directed graph $D$ connected to both $u$ and $v$ by edges in both direction. Thus, the graph contains lots of 2-cycles. $\endgroup$ Commented Jun 21 at 18:33
-
2$\begingroup$ Oh, or did you perhaps mean to define $F=\{(u,\{u,v\}),(v,\{u,v\}):\{u,v\}\in E\}$ so that the edges only go in one direction? This should actually work (even if $G$ is not connected). However, the resulting graph is not rooted, so you’d have at attach an extra root node. $\endgroup$ Commented Jun 21 at 18:50
-
$\begingroup$ Sorry, your construction of $F$ is indeed better. $\endgroup$ Commented Aug 21 at 9:48