min_edge_cover(G, matching_algorithm=None)
The smallest edge cover can be found in polynomial time by finding a maximum matching and extending it greedily so that all nodes are covered.
An edge cover of a graph is a set of edges such that every node of the graph is incident to at least one edge of the set. A minimum edge cover is an edge covering of smallest cardinality.
Due to its implementation, the worst-case running time of this algorithm is bounded by the worst-case running time of the function matching_algorithm
.
An undirected bipartite graph.
A function that returns a maximum cardinality matching in a given bipartite graph. The function must take one input, the graph G
, and return a dictionary mapping each node to its mate. If not specified, ~networkx.algorithms.bipartite.matching.hopcroft_karp_matching
will be used. Other possibilities include ~networkx.algorithms.bipartite.matching.eppstein_matching
,
A set of the edges in a minimum edge cover of the graph, given as pairs of nodes. It contains both the edges :None:None:`(u, v)`
and :None:None:`(v, u)`
for given nodes :None:None:`u`
and :None:None:`v`
among the edges of minimum edge cover.
Returns a set of edges which constitutes the minimum edge cover of the graph.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them