Crate graphlang

Source

Modules§

predefined

Structs§

Edge
Represents a single directed Edge and an optional label, which can be removed by using the zero-sized type (). It is recommended to use the corresponding ::new_* methods.
Graph
A Graph is in principle a owning tuple of Nodes and Edges.
GraphGrammar
A GraphGrammar yields different graphs, that are constructible using a starting graph and a list of transformations (productions). It is also used to further transform generated graphs using evolve. Refer to generate_random.
Isomorphism
An Isomorphism is a map from the matching graph to the matched subgraph. You most likely don’t want to construct it, but use the match_subgraph-method.
Node
Represents a single Node. It has an identifier and an optional label, which can be removed by using the zero-sized type ()
Production
A double-pushout production (DPO). For a description of the theory behind it please refer to the crates README.md.
QuitCondition
Used for randomly evolving a graph using a GraphGrammar to specify when to stop trying random productions. All fields are optional, but at least one must be used. Options can be set using the builder pattern on a newly created struct.

Functions§

are_graphs_isomorph
Checks if the two given graphs are (totally) isomorphic to each other, by checking if there exists a partial isomorphism from lhs to rhs and in the other direcetion. This function is very expensive.
match_subgraph
Tries to find an partial isomorphism from subgraph to graph. subgraph can be a disconnected graph. If None is returned if there is no mapping.