maximal_extendability#
- maximal_extendability(G)[source]#
Computes the extendability of a graph.
The extendability of a graph is defined as the maximum
for whichG
is -extendable. GraphG
is -extendable if and only ifG
has a perfect matching and every set of independent edges can be extended to a perfect matching inG
.- Parameters:
- GNetworkX Graph
A fully-connected bipartite graph without self-loops
- Returns:
- extendabilityint
- Raises:
- NetworkXError
If the graph
G
is disconnected. If the graphG
is not bipartite. If the graphG
does not contain a perfect matching. If the residual graph ofG
is not strongly connected.
Notes
Definition: Let
G
be a simple, connected, undirected and bipartite graph with a perfect matching M and bipartition (U,V). The residual graph ofG
, denoted by , is the graph obtained from G by directing the edges of M from V to U and the edges that do not belong to M from U to V.Lemma [1] : Let M be a perfect matching of
G
.G
is -extendable if and only if its residual graph is strongly connected and there are vertex-disjoint directed paths between every vertex of U and every vertex of V.Assuming that input graph
G
is undirected, simple, connected, bipartite and contains a perfect matching M, this function constructs the residual graph of G and returns the minimum value among the maximum vertex-disjoint directed paths between every vertex of U and every vertex of V in . By combining the definitions and the lemma, this value represents the extendability of the graphG
.Time complexity O(
)) where is the number of vertices and is the number of edges.References
[1]“A polynomial algorithm for the extendability problem in bipartite graphs”, J. Lakhal, L. Litzler, Information Processing Letters, 1998.
[2]“On n-extendible graphs”, M. D. Plummer, Discrete Mathematics, 31:201–210, 1980 https://doi.org/10.1016/0012-365X(80)90037-0