The filterGraphs and countGraphs methods both can use a tremendous number of constraints which are described by a rather tersely encoded string. This method builds that string given information in the HashTable h or the List l. Any keys which do not exist are simply ignored and any values which are not valid (e.g., exactly -3 vertices) are also ignored.
The values can either be Boolean or in ZZ. Boolean values are treated exactly as expected. Numerical values are more complicated; we use an example to illustrate how numerical values can be used, but note that this usage works for all numerically valued keys.
L = {graph {{1,2}}, graph {{1,2},{2,3}}, graph {{1,2},{2,3},{3,4}}, graph {{1,2},{2,3},{3,4},{4,5}}}; |
s = buildGraphFilter {"NumEdges" => 3}; |
filterGraphs(L, s) |
s = buildGraphFilter {"NumEdges" => (2,3)}; |
filterGraphs(L, s) |
s = buildGraphFilter {"NumEdges" => (,3)}; |
filterGraphs(L, s) |
s = buildGraphFilter {"NumEdges" => (2,)}; |
filterGraphs(L, s) |
s = buildGraphFilter {"NumEdges" => (2,), "NegateNumEdges" => true}; |
filterGraphs(L, s) |
The following are the boolean options: "Regular", "Bipartite", "Eulerian", "VertexTransitive".
Connectivity only works for the values 0, 1, 2 and uses the following definition of k-connectivity. A graph is k-connected if k is the minimum size of a set of vertices whose complement is not connected.
Thus, in order to filter for connected graphs, one must use {"Connectivity" => 0, "NegateConnectivity" => true}.