Class GraphDiff
- Namespace
- Graphity
- Assembly
- Graphity.Core.dll
The edges added and removed between two graphs over the same nodes, as Diff(Graph, Graph) returns them.
public sealed class GraphDiff
- Inheritance
-
GraphDiff
- Inherited Members
Remarks
Each edge comes with its edge index in the graph it belongs to: an added edge with its edge index in the newer graph, a removed edge with its edge index in the older one. With these edge indices, the caller can look up data on the edges of either graph in arrays indexed by edge index. Both lists are in edge index order. To see whether a graph changed without keeping the older one, compare hashes from TopologyHash(Graph) instead.
Instances are immutable and safe to share between threads.
Memory: 12 bytes per added or removed edge.
Properties
AddedEdges
Gets the edges of the newer graph that the older one does not have, with their edge indices in the newer graph, in edge index order.
public Edges AddedEdges { get; }
Property Value
Remarks
Time: O(1).
IsEmpty
Gets whether no edge was added or removed, that is, whether the two graphs are equal. Equivalent
to AddedEdges.IsEmpty && RemovedEdges.IsEmpty.
public bool IsEmpty { get; }
Property Value
Remarks
Time: O(1).
RemovedEdges
Gets the edges of the older graph that the newer one does not have, with their edge indices in the older graph, in edge index order.
public Edges RemovedEdges { get; }
Property Value
Remarks
Time: O(1).
Methods
ToString()
Returns the numbers of added and removed edges, for debuggers and logs.
public override string ToString()
Returns
- string
The text.
Remarks
Time: O(1).