In order to perform the matching, you have to choose which kind
of relation you are interested in (e.g. isomorphism), and which
algorithm you want to use. To make this choice, you need to create
an instance of a class derived from the State
class, which
represents the starting point in the search space of the algorithm.
Table
Matching algorithms
presents the available choices.
Once you have chosen the right class, you need to create an instance of it, passing to the constructor a pointer to the two graphs being matched. If the matching relation is graph-subgraph isomorphism or monomorphism, the role of the two graph is not symmetric. In this case, the first constructor parameter must be the smallest of the two graphs.
For example, suppose you need to perform a graph-subgraph isomorphism, and decide to use the VF2 algorithm. The code needed to initialize the search state is:
#include "argraph.h"
#include "argedit.h"
#include "vf2_sub_state.h"
int main()
{ ARGEdit small_ed, large_ed;
//... some code here should construct the graphs ...
Graph small_graph(&small_ed), large_graph(&large_ed);
// Create the initial state of the search space
VF2SubState s0(&small_graph, &large_graph);
//... to be continued ...