C

BipartitionResult

Represents a bipartition of a graph.
Inheritance Hierarchy

Remarks

If a bipartition of the graph exists, isBipartite is true and firstPartition and secondPartition contain the nodes that make up the partitions. The inSamePartition method can be used to determine whether two nodes are in the same partition.

If no bipartition of the graph exists, isBipartite is false and any collections and mappings of the result are empty.

This class cannot be instantiated

Members

No filters for this type

Properties

Gets the first partition of a bipartite graph.
If the graph is not bipartite, this partition is empty.
readonlyfinal
Gets a value indicating whether this result represents a bipartition of the graph.

If the original graph is not bipartite, this is set to false and all collections and mappings of this result are empty.

When using Bipartition, isBipartite should always be checked first before working with the result.

readonlyfinal
Gets a mapping from each node to its partition.

This is either the firstPartition or the secondPartition.

If the graph is not bipartite, this mapping is empty and returns null for all nodes.

readonlyfinal
Gets the second partition of a bipartite graph.
If the graph is not bipartite, this partition is empty.
readonlyfinal

Methods

Returns a value indicating whether the specified nodes are in the same partition.
final

Parameters

node1: INode
The first node to test.
node2: INode
The second node to test.

Return Value

boolean
true if both nodes are in the same partition, false if they are in different partitions. If the graph is not bipartite, true is returned.