59#ifndef __ADS_MinimumSpanningTree
60 #define __ADS_MinimumSpanningTree
118std::vector< WeightedEdge< typename G::Weight > >
edges(
const G & g );
147std::vector< WeightedEdge< W > >
155 { m.merge( u , v ) } -> std::convertible_to< bool >;
182template<
class W , Mergeable M >
183std::vector< WeightedEdge< W > >
256template< Graph G , FrontierQueue Q >
257std::vector< int >
prim(
const G & g ,
int r , Q & q ,
293#include "ADS/graph/impl/MinimumSpanningTree.tpp"
The capabilities of the structures, beyond the book: what an algorithm may ask of its argument to cho...
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The PRIORITYQUEUE [see PriorityQueue.h] on a Fibonacci heap, the structure that section 11....
The PRIORITYQUEUE [see PriorityQueue.h] on a heap.
The PRIORITYQUEUE [see PriorityQueue.h] on a list.
The MFSET of section 10.2, the union of disjoint sets: MFSet( n ) makes the components ,...
The shortest paths of chapter 11 from a node of an oriented GRAPH whose edges have a cost [see Grap...
a union of disjoint sets as kruskal() needs it: merge( u , v ) joins the components of u and v and te...
Definition MinimumSpanningTree.h:153
The GRAPH of chapter 9 and its realizations.
std::vector< WeightedEdge< typename G::Weight > > edges(const G &g)
the edges of an unoriented graph, each once, from its smaller end
std::vector< int > prim(const G &g, int r, Frontier how=Frontier::HEAP)
the parents of the tree from , NIL for and the nodes out of its component; how is LIST,...
bool isMinimumSpanningForest(int n, const std::vector< WeightedEdge< W > > &A, const std::vector< WeightedEdge< W > > &T)
whether is a minimum spanning forest of the edges on the nodes : its edges are in A,...
std::vector< WeightedEdge< W > > kruskal(int n, std::vector< WeightedEdge< W > > A, long k=0)
the edges of a minimum spanning forest of the nodes ; with the weights are integers in ,...
Frontier
the structure of the prototype
Definition ShortestPaths.h:135
@ HEAP
a priority queue on a binary heap: Johnson
Definition ShortestPaths.h:137
what a run of the prototype did: the nodes added to (the lines (1) and (3)), the extractions (2),...
Definition ShortestPaths.h:171
what a run of kruskal() did: the merges tried and those that joined two components
Definition MinimumSpanningTree.h:161
long long unions
the merges that joined two components
Definition MinimumSpanningTree.h:163
long long merges
the merges tried
Definition MinimumSpanningTree.h:162
an edge of weight
Definition MinimumSpanningTree.h:94
W w
the weight
Definition MinimumSpanningTree.h:97
int v
the other end
Definition MinimumSpanningTree.h:96
int u
one end
Definition MinimumSpanningTree.h:95
bool operator==(const WeightedEdge &) const =default
whether the two edges have the same ends, in order, and weight