net.sourceforge.combean.interfaces.graph.alg.spath
Interface PathAlgebra<NumType extends Comparable<NumType>>

Package class diagram package PathAlgebra
All Known Implementing Classes:
DoubleValuedPathAlgebra

public interface PathAlgebra<NumType extends Comparable<NumType>>

This interface contains the operations which are needed to calculate the weights of paths in graphs. Usually, this will involve summing the numeric weights of individual edges and taking the minimum over all possible paths to a node, but different usages are supported.


Method Summary
 NumType add(NumType pathLenOne, NumType pathLenTwo)
          Add the length of to paths, yielding the length of the combined path
 NumType emptyPathLen()
          Return a value 'zero' which must be the neutral element of the operation max and is equal to the length of an empty path.
 NumType infinitePathLen()
          Return a value 'infinity' which must be the neutral element of the operation min.
 NumType min(NumType pathLenOne, NumType pathLenTwo)
          Calculate the minimum distance of a node.
 

Method Detail

add

NumType add(NumType pathLenOne,
            NumType pathLenTwo)
Add the length of to paths, yielding the length of the combined path

Parameters:
pathLenOne -
pathLenTwo -
Returns:
the length of the concatenation of the two paths (which are assumed to be node disjoint.

min

NumType min(NumType pathLenOne,
            NumType pathLenTwo)
Calculate the minimum distance of a node. Assume that two paths lead to the same node. This function calculates distance of this node to the source (usually taking the minimum of the two values but different functions might be considered for certain applications).

Parameters:
pathLenOne -
pathLenTwo -
Returns:
the 'minimum' length of the two paths

infinitePathLen

NumType infinitePathLen()
Return a value 'infinity' which must be the neutral element of the operation min.

Returns:
the length of an 'infinite' path.

emptyPathLen

NumType emptyPathLen()
Return a value 'zero' which must be the neutral element of the operation max and is equal to the length of an empty path.

Returns:
the length of an empty path.