5
$\begingroup$

Suppose we have two directed acyclic graphs $A$ and $B$ and we look to find the subgraph that is common to both graphs and has the most number of vertices. That is to find the biggest graph which is a subgraph of both $A$ and $B$. The vertices are not labeled, but of course, the directions on edges do matter.

Noting that this solves the graph isomorphism, the problem is not known to be solvable in polynomial time. So I was looking for an approximation algorithm. Can you think of any?

$\endgroup$
  • 5
    $\begingroup$ Isn't there a straightforward approximation-preserving reduction from maximum independent set (MIS) in undirected graphs to your problem? Given undirected graph G=(V,E), form DAG A=(V,E') by ordering the vertices arbitrarily and directing the edges accordingly, then take B=(V,{}) to be the DAG with the same vertices but no edges. Any subgraph common to A and B corresponds to an independent set in G, and vice versa, no? (If this reduction is correct, then your problem is as hard to approximate as MIS; which is to say, forget about it. :-). What am I missing? $\endgroup$ – Neal Young May 20 '13 at 3:00
  • $\begingroup$ You are right Mr.Young . I guess it won't work. I think you should post that as an answer. $\endgroup$ – Untitled May 20 '13 at 8:49
  • $\begingroup$ @Unititled: okay. $\endgroup$ – Neal Young May 20 '13 at 15:21
  • $\begingroup$ I interpreted the question as wanting the subgraph on the maximum number of edges, not the induced subgraph on the maximum number of vertices... $\endgroup$ – Andrew D. King May 21 '13 at 15:48
  • $\begingroup$ @ King. You are right, it looks ambiguous. I'm editing the question. $\endgroup$ – Untitled May 21 '13 at 16:50
12
$\begingroup$

Isn't there a straightforward approximation-preserving reduction from maximum independent set (MIS) in undirected graphs to your problem?

Given undirected graph G=(V,E), form DAG A=(V,E') by ordering the vertices arbitrarily and directing the edges accordingly, then take B=(V,{}) to be the DAG with the same vertices but no edges.

Any subgraph common to A and B corresponds to an independent set in G, and vice versa, no?

If this reduction is correct, then your problem is as hard to approximate as MIS; which is to say, forget about it. :-)

$\endgroup$
2
$\begingroup$

I recall Jason's thesis had something on this, application was finding differences between versions in a code repository: http://archives.ece.iastate.edu/archive/00000493/01/dissertation.pdf

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.