GrGen.NET v4.4 API: the libGr class library (the type exact interface gets generated)
IGraph Interface
An attributed, typed and directed multigraph with multiple inheritance on node and edge types.
Declaration Syntax
C#
public interface IGraph
Members
All MembersMethodsPropertiesEvents



IconMemberDescription
AddEdge(IEdge)
Adds an existing IEdge object to the graph. The edge must not be part of any graph, yet! Source and target of the edge must already be part of the graph.

AddEdge(EdgeType, INode, INode)
Adds a new edge to the graph.

AddNode(INode)
Adds an existing INode object to the graph. The node must not be part of any graph, yet! The node may not be connected to any other elements!

AddNode(NodeType)
Adds a new node to the graph.

AllocateVisitedFlag()()()()
Allocates a visited flag on the graph elements.

Backend
The backend that created the graph

Canonize()()()()
Returns a canonical representation of the graph as a string

ChangedEdgeAttribute(IEdge, AttributeType)
Fires an OnChangedEdgeAttribute event. For debugging, won't be automatically called in case of -nodebugevents, attribute change rollback is based on the pre-events.

ChangedNodeAttribute(INode, AttributeType)
Fires an OnChangedNodeAttribute event. For debugging, won't be automatically called in case of -nodebugevents, attribute change rollback is based on the pre-events.

ChangesCounter
Returns a counter of the number of changes that occured since the graph was created. If it's different since last time you visited, the graph has changed (but it may be back again in the original state). Only graph structure changes are counted, attribute changes are not included.

ChangingEdgeAttribute(IEdge, AttributeType, AttributeChangeType, Object, Object)
Fires an OnChangingEdgeAttribute event. To be called before changing an attribute of an edge, with exact information about the change to occur, to allow rollback of changes, in case a transaction is underway.

ChangingNodeAttribute(INode, AttributeType, AttributeChangeType, Object, Object)
Fires an OnChangingNodeAttribute event. To be called before changing an attribute of a node, with exact information about the change to occur, to allow rollback of changes, in case a transaction is underway.

Check()()()()
Checks whether the internal data structures are ok (will throw an exception if they are not). This is for debugging the underlying implementation from positions outside the implementation.

Clear()()()()
Removes all nodes and edges from the graph (so any variables pointing to them start dangling).

Clone(String)
Duplicates a graph. The new graph will use the same model and backend as the other.

CloneAndAssignNames()()()()
Duplicates a graph, assigning names. The new graph will use the same model and backend as the other.

CreateEmptyEquivalent(String)
Creates an empty graph using the same model and backend as the other.

Custom(array<Object>[]()[][])
Does graph-backend dependent stuff.

Edges
Enumerates all edges in the graph.

FreeVisitedFlag(Int32)
Frees a visited flag. This is a safe but O(n) operation, as it resets the visited flag in the graph.

FreeVisitedFlagNonReset(Int32)
Frees a clean visited flag. This is an O(1) but potentially unsafe operation. Attention! A marked element stays marked, so a later allocation hands out a dirty visited flag! Use only if you can ensure that all elements of that flag are unmarked before calling.

GetAllocatedVisitedFlags()()()()
Returns the ids of the allocated visited flags.

GetCompatibleEdges(EdgeType)
Enumerates all edges compatible to the given edge type.

GetCompatibleNodes(NodeType)
Enumerates all nodes compatible to the given node type.

GetEdge(Int32)
Gets the edge for the given id. Only available if the unique index was declared in the model.

GetExactEdges(EdgeType)
Enumerates all edges with the exact given edge type.

GetExactNodes(NodeType)
Enumerates all nodes with the exact given node type.

GetGraphElement(Int32)
Gets the graph element for the given unique id. Only available if the unique index was declared in the model.

GetNode(Int32)
Gets the node for the given unique id. Only available if the unique index was declared in the model.

GetNumCompatibleEdges(EdgeType)
Returns the number of edges compatible to the given edge type.

GetNumCompatibleNodes(NodeType)
Returns the number of nodes compatible to the given node type.

GetNumExactEdges(EdgeType)
Returns the number of edges with the exact given edge type.

GetNumExactNodes(NodeType)
Returns the number of nodes with the exact given node type.

GraphId
A unique id associated with the graph

HasSameStructure(IGraph)
Returns whether this graph is isomorph to that graph, neglecting the attribute values, only structurally

HasSameStructure(IDictionary<(Of <<'(IGraph, SetValueType>)>>))
Returns whether this graph is isomorph to any of the set of graphs given, neglecting the attribute values, only structurally Don't call from a parallelized matcher!

Indices
The indices associated with the graph.

IsInternallyVisited(IGraphElement)
Returns whether the given graph element has been internally visited. (Used for computing reachability.)

IsInternallyVisited(IGraphElement, Int32)
Returns whether the given graph element has been internally visited. (Used for computing reachability when employed from a parallelized matcher executed by the thread pool.)

IsIsomorph(IGraph)
Returns whether this graph is isomorph to that graph (including the attribute values) If a graph changed only in attribute values since the last comparison, results will be wrong! (Do a fake node insert and removal to ensure the graph is recognized as having changed.)

IsIsomorph(IDictionary<(Of <<'(IGraph, SetValueType>)>>))
Returns whether this graph is isomorph to any of the set of graphs given (including the attribute values) If a graph changed only in attribute values since the last comparison, results will be wrong! (Do a fake node insert and removal to ensure the graph is recognized as having changed.) Don't call from a parallelized matcher!

IsVisited(IGraphElement, Int32)
Returns whether the given graph element has been visited.

Merge(INode, INode, String)
Merges the source node into the target node, i.e. all edges incident to the source node are redirected to the target node, then the source node is deleted.

Model
The model associated with the graph.

Name
A name associated with the graph.

Nodes
Enumerates all nodes in the graph.

NumEdges
The total number of edges in the graph.

NumNodes
The total number of nodes in the graph.

OnChangedEdgeAttribute
Fired after an attribute of an edge is changed; for debugging purpose. Note for LGSPBackend: Because graph elements of the LGSPBackend don't know their graph a call to LGSPGraphElement.SetAttribute will not fire this event. If you use this function and want the event to be fired, you have to fire it yourself using ChangedEdgeAttributes.

OnChangedNodeAttribute
Fired after an attribute of a node is changed; for debugging purpose. Note for LGSPBackend: Because graph elements of the LGSPBackend don't know their graph a call to LGSPGraphElement.SetAttribute will not fire this event. If you use this function and want the event to be fired, you have to fire it yourself using ChangedNodeAttributes.

OnChangingEdgeAttribute
Fired before an attribute of an edge is changed. Note for LGSPBackend: Because graph elements of the LGSPBackend don't know their graph a call to LGSPGraphElement.SetAttribute will not fire this event. If you use this function and want the event to be fired, you have to fire it yourself using ChangingEdgeAttributes.

OnChangingNodeAttribute
Fired before an attribute of a node is changed. Note for LGSPBackend: Because graph elements of the LGSPBackend don't know their graph a call to LGSPGraphElement.SetAttribute will not fire this event. If you use this function and want the event to be fired, you have to fire it yourself using ChangingNodeAttributes.

OnClearingGraph
Fired before the whole graph is cleared

OnEdgeAdded
Fired after an edge has been added

OnNodeAdded
Fired after a node has been added

OnRedirectingEdge
Fired before an edge is redirected (causing removal then adding again). The edge to be redirected is provided to the handler.

OnRemovingEdge
Fired before an edge is deleted

OnRemovingEdges
Fired before all edges of a node are deleted

OnRemovingNode
Fired before a node is deleted

OnRetypingEdge
Fired before the type of an edge is changed. Old and new edges are provided to the handler.

OnRetypingNode
Fired before the type of a node is changed. Old and new nodes are provided to the handler.

OnSettingAddedEdgeNames
Fired before each rewrite step (also rewrite steps of subpatterns) to indicate the names of the edges added in this rewrite step in order of addition.

OnSettingAddedNodeNames
Fired before each rewrite step (also rewrite steps of subpatterns) to indicate the names of the nodes added in this rewrite step in order of addition.

OnSettingVisited
Fired before a visited flag is set.

OnVisitedAlloc
Fired after a visited flag was allocated.

OnVisitedFree
Fired after a visited flag was freed.

RedirectSource(IEdge, INode, String)
Changes the source node of the edge from the old source to the given new source.

RedirectSourceAndTarget(IEdge, INode, INode, String, String)
Changes the source of the edge from the old source to the given new source, and changes the target node of the edge from the old target to the given new target.

RedirectTarget(IEdge, INode, String)
Changes the target node of the edge from the old target to the given new target.

Remove(INode)
Removes the given node from the graph. There must be no edges left incident to the node (you may use RemoveEdges to ensure this).

Remove(IEdge)
Removes the given edge from the graph.

RemoveEdges(INode)
Removes all edges from the given node.

ResetVisitedFlag(Int32)
Resets the visited flag with the given ID on all graph elements, if necessary.

Retype(INode, NodeType)
Retypes a node by creating a new node of the given type. All incident edges as well as all attributes from common super classes are kept.

Retype(IEdge, EdgeType)
Retypes an edge by creating a new edge of the given type. Source and target node as well as all attributes from common super classes are kept.

ReuseOptimization
If true (the default case), elements deleted during a rewrite may be reused in the same rewrite. As a result new elements may not be discriminable anymore from already deleted elements using object equality, hash maps, etc. In cases where this is needed this optimization should be disabled.

SetInternallyVisited(IGraphElement, Boolean)
Sets the internal-use visited flag of the given graph element. (Used for computing reachability.)

SetInternallyVisited(IGraphElement, Boolean, Int32)
Sets the internal-use visited flag of the given graph element. (Used for computing reachability when employed from a parallelized matcher executed by the thread pool.)

SetVisited(IGraphElement, Int32, Boolean)
Sets the visited flag of the given graph element.

Validate(ValidationMode, List<(Of <<'(ConnectionAssertionError>)>>)%)
Checks whether a graph meets the connection assertions.

Assembly: libGr (Module: libGr) Version: 4.4.0.0 (4.4.0.0)