summaryrefslogtreecommitdiffstats
path: root/core/sliPluginUtils/provider/src/main/java/org/onap/ccsdk/sli/core/slipluginutils/slitopologyutils/graph/EdgeWeigher.java
blob: 008204456c862b1d3a8bacaaa783cfb210776745 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.onap.ccsdk.sli.core.slipluginutils.slitopologyutils.graph;

/**
 * Abstraction of a graph edge weight function.
 */
public interface EdgeWeigher<V extends Vertex, E extends Edge<V>> {

    /**
     * Returns the weight of the given edge.
     *
     * @param edge edge to be weighed
     * @return edge weight
     */
    Weight weight(E edge);

    /**
     * Returns initial weight value (i.e. weight of a "path" starting and
     * terminating in the same vertex; typically 0 value is used).
     *
     * @return null path weight
     */
    Weight getInitialWeight();

    /**
     * Returns weight of a link/path that should be skipped
     * (can be considered as an infinite weight).
     *
     * @return non viable weight
     */
    Weight getNonViableWeight();
}