[Lemon-devel] Check function and algorithm interface

Balazs Dezso deba at inf.elte.hu
Tue Dec 2 08:59:16 CET 2008


Dear Developers,

The algorithm checking is important issue, therefore I think we should use 
uniform interface for it. For example it can be made efficiently for several 
algorithms: shortest paths, max flows, min cost flows, circulations, matchings, 
etc. I think separate functions would the most efficient solution for this 
purpose, one which uses the uniform interface of the algorithm, and another 
one which uses the maps used or set by algorithm.

checkMaxFlow(maxFlowAlg);
checkMaxFlow(digraph, capacity, s, t, flow, cut);

Currently just in the Circulation are there checking functions, but those are 
member functions. In the tests directory we use similar checks for shortest 
paths, max flows, matchings.

The other topic is the interface of the algorithm. I think we should provide 
similar interface for similar algorithms. The flow problems, the matchings and 
similar duality based algorithms can follow common approach. For example for a 
max flow problem:
Value flow(Arc);
typename <template FlowMap> void flowMap(FlowMap&);
Value flowValue();
bool minCut(Node);
typename <typename CutMap> void minCutMap(CutMap&);
Value minCutValue();

I think, we should decide a good policy for naming this kind of member 
functions.

Best, Balazs



More information about the Lemon-devel mailing list