jessLryan / FPTSubgraphCounting

0 stars 0 forks source link

FPT Subgraph Counting Algorithm

An implementation of an algorithm described in [1] for counting the number of times that one graph appears as a subgraph of the other.

The algorithm is expected to be efficient when the first graph is small, and the second graph has only a small proportion of high-degree vertices.

More formally, the algorithm is an FPT algorithm for labelled subgraph counting in classes of host graphs from the class of graphs with almost-bounded degree parameterised by the order of the pattern graph.

Input

The algorithm takes two inputs: a file containing the pattern graph data, and a file containing the host graph data.

The file for each graph must be a .txt file written in LAD format where the first line states the number of vertices in the graph, and the next $n$ lines state, for each vertex, its number of successor nodes, followed by the list of its successor nodes.

For example, the complete graph $K_4$ would be written as

4
3 1 2 3
3 0 2 3
3 0 1 3
3 0 1 2

Output

The result is printed to the screen and contains the following information:

References

[1] Ryan, Jessica Laurette, Parameterised Algorithms for Counting Subgraphs, Matchings, and Monochromatic Partitions, PhD Thesis, 2023