mosp LEDA Extension Package
0.7
|
Functions | |
leda::list< leda::edge > | mosp::BI_RANK_MAX_MATCHING (leda::graph &G, const leda::edge_array< int > &rank) |
Compute a rank-maximal matching of a bipartite graph. More... | |
leda::list< leda::edge > | mosp::BI_RANK_MAX_MATCHING_MWMR (leda::graph &G, const leda::edge_array< int > &rank) |
Compute a rank-maximal matching of a bipartite graph. More... | |
leda::list< leda::edge > | mosp::DBI_RANK_MAX_MATCHING_MWMR (leda::graph &G, const leda::edge_array< int > &rank) |
Compute a rank-maximal matching of a bipartite graph. More... | |
leda::array< int > | mosp::BI_RANK_MAX_MATCHING_PROFILE (const leda::graph &G, const leda::edge_array< int > &rank, const leda::list< leda::edge > &matching) |
Compute the profile of a matching. More... | |
leda::list< leda::edge > | mosp::BI_RANK_MAX_CAPACITATED_MATCHING (const leda::graph &G, const leda::list< leda::node > &A, const leda::list< leda::node > &B, const leda::node_array< int > &capacity, const leda::edge_array< int > &rank) |
Compute a rank-maximal matching of a bipartite graph with capacities on the right side of the bipartite graph. More... | |
leda::list<leda::edge> mosp::BI_RANK_MAX_CAPACITATED_MATCHING | ( | const leda::graph & | G, |
const leda::list< leda::node > & | A, | ||
const leda::list< leda::node > & | B, | ||
const leda::node_array< int > & | capacity, | ||
const leda::edge_array< int > & | rank | ||
) |
Compute a rank-maximal matching of a bipartite graph with capacities on the right side of the bipartite graph.
The function computes a Rank-Maximal matching of
, that is a matching which uses the largest possible number of rank one edges, and subject to this constraint the largest possible number of rank two edges and so on. Nodes on the right side of the partition may be matched multiple times. This is why the user must provide a capacity function on the nodes plus a partition of the nodes such that all edges are from A to B.
The matching is returned as a list of edges. The running time is .
During the algorithm the input graph is copied and everything happens on the copy.
G | The graph |
A | Nodes of the left-side partition of the bipartite graph. |
B | Nodes of the right-side partition of the bipartite graph. |
capacity | Node capacities |
rank | A rank function on the edges. |
leda::list<leda::edge> mosp::BI_RANK_MAX_MATCHING | ( | leda::graph & | G, |
const leda::edge_array< int > & | rank | ||
) |
Compute a rank-maximal matching of a bipartite graph.
The function computes a Rank-Maximal matching of
, that is a matching which uses the largest possible number of rank one edges, and subject to this constraint the largest possible number of rank two edges and so on. The matching is returned as a list of edges. The running time is
where
is the maximum rank of an edge in the input.
G | The graph |
rank | A rank function on the edges. |
leda::list<leda::edge> mosp::BI_RANK_MAX_MATCHING_MWMR | ( | leda::graph & | G, |
const leda::edge_array< int > & | rank | ||
) |
Compute a rank-maximal matching of a bipartite graph.
The function computes a Rank-Maximal matching of
, that is a matching which uses the largest possible number of rank one edges, and subject to this the largest possible number of rank two edges and so on. The matching is returned as a list of edges. This procedure solves the problem by reducing it to the maximum weight matching problem, and therefore the running time is
. The second
comes from the possibly large cost of arithmetic since the reduction involves edge weights which can be as large as
. The space requirement is
.
G | The graph |
rank | A rank function on the edges. |
leda::array<int> mosp::BI_RANK_MAX_MATCHING_PROFILE | ( | const leda::graph & | G, |
const leda::edge_array< int > & | rank, | ||
const leda::list< leda::edge > & | matching | ||
) |
Compute the profile of a matching.
The function returns an array of non-negative integers representing the number of edges of each rank belonging to the matching. This array is indexed from
to
, where
is the number of vertices of
. The running time is
where
is the number of nodes of
. Note that this procedure does not check whether the list of edges is really a matching or not.
G | The input bipartite graph. |
rank | An edge rank function. |
matching | A matching. |
leda::list<leda::edge> mosp::DBI_RANK_MAX_MATCHING_MWMR | ( | leda::graph & | G, |
const leda::edge_array< int > & | rank | ||
) |
Compute a rank-maximal matching of a bipartite graph.
The function computes a Rank-Maximal matching of
, that is a matching which uses the largest possible number of rank one edges, and subject to this the largest possible number of rank two edges and so on. The matching is returned as a list of edges. This procedure solves the problem by reducing it to the maximum weight matching problem. The reduction is implicit resulting to a running time of
where
is the maximum rank of an edge in the input and linear space.
G | The graph |
rank | A rank function on the edges. |