Satsuma
a delicious .NET graph library
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | Properties | List of all members
Satsuma.IMatching Interface Reference

Interface to a read-only matching. More...

Inheritance diagram for Satsuma.IMatching:
Satsuma.IGraph Satsuma.IArcLookup Satsuma.Matching

Public Member Functions

int ArcCount (ArcFilter filter=ArcFilter.All)
 Returns the total number of arcs satisfying a given filter. More...
 
int ArcCount (Node u, ArcFilter filter=ArcFilter.All)
 Returns the number of arcs adjacent to a specific node satisfying a given filter. More...
 
int ArcCount (Node u, Node v, ArcFilter filter=ArcFilter.All)
 Returns the number of arcs adjacent to two nodes satisfying a given filter. More...
 
IEnumerable< ArcArcs (ArcFilter filter=ArcFilter.All)
 
IEnumerable< ArcArcs (Node u, ArcFilter filter=ArcFilter.All)
 
IEnumerable< ArcArcs (Node u, Node v, ArcFilter filter=ArcFilter.All)
 
bool HasArc (Arc arc)
 Returns whether the given arc is contained in the graph. More...
 
bool HasNode (Node node)
 Returns whether the given node is contained in the graph. More...
 
bool IsEdge (Arc arc)
 Returns whether the arc is undirected (true) or directed (false). More...
 
Arc MatchedArc (Node node)
 Gets the matching arc which contains the given node. More...
 
int NodeCount ()
 Returns the total number of nodes in O(1) time. More...
 
IEnumerable< NodeNodes ()
 Returns all nodes of the graph. More...
 
Node U (Arc arc)
 Returns the first node of an arc. Directed arcs point from U to V. More...
 
Node V (Arc arc)
 Returns the second node of an arc. Directed arcs point from U to V. More...
 

Properties

IGraph Graph [get]
 The underlying graph, i.e. the graph containing the matching. More...
 

Detailed Description

Interface to a read-only matching.

A matching is a subgraph without loop arcs where the degree of each node of the containing graph is at most 1. The node set of a matching consists of those nodes whose degree is 1 in the matching.

Definition at line 14 of file Matching.cs.

Member Function Documentation

int Satsuma.IGraph.ArcCount ( ArcFilter  filter = ArcFilter.All)
inherited
int Satsuma.IGraph.ArcCount ( Node  u,
ArcFilter  filter = ArcFilter.All 
)
inherited

Returns the number of arcs adjacent to a specific node satisfying a given filter.

Parameters
filterDetailed description: see Arcs(Node, ArcFilter).

Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.

int Satsuma.IGraph.ArcCount ( Node  u,
Node  v,
ArcFilter  filter = ArcFilter.All 
)
inherited
IEnumerable<Arc> Satsuma.IGraph.Arcs ( ArcFilter  filter = ArcFilter.All)
inherited

Returns all arcs of the graph satisfying a given filter.

Parameters
filterCannot be ArcType.Forward/ArcType.Backward.
  • If ArcFilter.All, then all arcs are returned.
  • If ArcFilter.Edge, only the edges (undirected arcs) are returned.

Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.

IEnumerable<Arc> Satsuma.IGraph.Arcs ( Node  u,
ArcFilter  filter = ArcFilter.All 
)
inherited

Returns all arcs adjacent to a specific node satisfying a given filter.

Parameters
filter
  • If ArcFilter.All, then all arcs are returned.
  • If ArcFilter.Edge, only the edges (undirected arcs) are returned.
  • If ArcFilter.Forward, only the arcs exiting u (this includes edges) are returned.
  • If ArcFilter.Backward, only the arcs entering u (this includes edges) are returned.

Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.Matching, Satsuma.ContractedGraph, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.

IEnumerable<Arc> Satsuma.IGraph.Arcs ( Node  u,
Node  v,
ArcFilter  filter = ArcFilter.All 
)
inherited

Returns all arcs adjacent to two nodes satisfying a given filter.

Parameters
filter
  • If ArcFilter.All, then all arcs are returned.
  • If ArcFilter.Edge, only the edges (undirected arcs) are returned.
  • If ArcFilter.Forward, only the arcs from u to v (this includes edges) are returned.
  • If ArcFilter.Backward, only the arcs from v to u (this includes edges) are returned.

Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.Subgraph, Satsuma.CompleteGraph, Satsuma.ContractedGraph, Satsuma.Matching, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.

bool Satsuma.IGraph.HasArc ( Arc  arc)
inherited

Returns whether the given arc is contained in the graph.

Must return the same value as Arcs().Contains in all implementations, but faster if possible.

Note
true may be returned for arcs coming from another graph as well, if those arcs encapsulate an identifier which is valid for this graph, too.

Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.CompleteGraph, Satsuma.Subgraph, Satsuma.Matching, Satsuma.ContractedGraph, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.

bool Satsuma.IGraph.HasNode ( Node  node)
inherited

Returns whether the given node is contained in the graph.

Must return the same value as Nodes().Contains in all implementations, but faster if possible.

Note
true may be returned for nodes coming from another graph as well, if those nodes encapsulate an identifier which is valid for this graph, too.

Implemented in Satsuma.PathGraph, Satsuma.Supergraph, Satsuma.Path, Satsuma.CompleteBipartiteGraph, Satsuma.CompleteGraph, Satsuma.Subgraph, Satsuma.Matching, Satsuma.ContractedGraph, Satsuma.RedirectedGraph, Satsuma.ReverseGraph, and Satsuma.UndirectedGraph.

bool Satsuma.IArcLookup.IsEdge ( Arc  arc)
inherited
Arc Satsuma.IMatching.MatchedArc ( Node  node)

Gets the matching arc which contains the given node.

Equivalent to Arcs(node).FirstOrDefault(), but should be faster.

Parameters
nodeA node of Graph.
Returns
The arc which matches the given node, or Arc.Invalid if the node is unmatched.

Implemented in Satsuma.Matching.

int Satsuma.IGraph.NodeCount ( )
inherited
IEnumerable<Node> Satsuma.IGraph.Nodes ( )
inherited
Node Satsuma.IArcLookup.U ( Arc  arc)
inherited
Node Satsuma.IArcLookup.V ( Arc  arc)
inherited

Property Documentation

IGraph Satsuma.IMatching.Graph
get

The underlying graph, i.e. the graph containing the matching.

Definition at line 17 of file Matching.cs.


The documentation for this interface was generated from the following file: