Incorrect result from mcgregor_common_subgraphs. Where can I find more example of this MCS solver?
Hi, I am a beginner with BGL. Currently I am using mcgregor_common_subgraphs
solver to find all the common subgraphs between two graphs. The following
link is the only one example showing how to use the library that I can find
from the Internet.
http://svn.kulitorum.com/RepSnapper/Libraries/Boost1.40/libs/graph/example/m...
My first question is where can I find more example of this MCS solver?
My second question is why some times it can not find maximum common
subgraph. By maximum I mean a common subgraph with largest number of
vertices which is implemented in the code.
Here I provide an example. This code is modified from
mcgregor_subgraphs_example, I change the graph to undirected graph and add
some vetices and edges. It is obvious that the correct answer should be of
size 9. The answer return by the code missing edge 8-5 and 8-3.
//=======================================================================
// Copyright 2009 Trustees of Indiana University.
// Authors: Michael Hansen
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <fstream>
#include <iostream>
#include <string>
#include
On Mon, 8 Jul 2013, dante0125 wrote:
Hi, I am a beginner with BGL. Currently I am using mcgregor_common_subgraphs solver to find all the common subgraphs between two graphs. The following link is the only one example showing how to use the library that I can find from the Internet. http://svn.kulitorum.com/RepSnapper/Libraries/Boost1.40/libs/graph/example/m...
My first question is where can I find more example of this MCS solver?
One place is libs/graph/test/mcgregor_subgraphs_test.cpp in the Boost source tree.
My second question is why some times it can not find maximum common subgraph. By maximum I mean a common subgraph with largest number of vertices which is implemented in the code. Here I provide an example. This code is modified from mcgregor_subgraphs_example, I change the graph to undirected graph and add some vetices and edges. It is obvious that the correct answer should be of size 9. The answer return by the code missing edge 8-5 and 8-3.
Have you tried using mcgregor_common_subgraphs_maximum or mcgregor_common_subgraphs_maximum_unique? The algorithm only returns a mapping between vertices, so I'm not sure what you mean by the result missing edges. -- Jeremiah Willcock
Thanks for your reply. For the second part, I know there are four functions to compute the common graphs. I use "mcgregor_common_subgraphs_unique" in this example. This function can return all the common subgraphs between two graphs. When I am replying this post, I tried mcgregor_common_subgraphs_maximum_unique. The result if the same size-7 graph. Because, in the example I mentioned above, the answer seems correct. I use this solver for my project then I found that this solver in many cases can not find the maximum common subgraph. The back-tracking method stops at some points it should not. In this example I used in the post, the program supposed to continue to find the adjacent vertices of vertex 8 but it stops. -- View this message in context: http://boost.2283326.n4.nabble.com/Incorrect-result-from-mcgregor-common-sub... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
dante0125
-
Jeremiah Willcock