Vector cost proposed to TST on 2016-07-13

First part implemented: weight interface introduced and integrated, default weight implementation added.

Change-Id: Ia46f1b44139069aa171a3c13faf168351bd7cc56
diff --git a/core/api/src/main/java/org/onosproject/net/topology/AbstractPathService.java b/core/api/src/main/java/org/onosproject/net/topology/AbstractPathService.java
index 8b24cbb..2c43fc7 100644
--- a/core/api/src/main/java/org/onosproject/net/topology/AbstractPathService.java
+++ b/core/api/src/main/java/org/onosproject/net/topology/AbstractPathService.java
@@ -18,6 +18,7 @@
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
+import org.onlab.graph.Weight;
 import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.DefaultDisjointPath;
 import org.onosproject.net.DefaultEdgeLink;
@@ -40,6 +41,7 @@
 import java.util.Set;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import static org.onosproject.net.topology.AdapterLinkWeigher.adapt;
 
 /**
  * Helper class for path service.
@@ -56,15 +58,25 @@
     private static final ProviderId PID = new ProviderId("core", "org.onosproject.core");
     private static final PortNumber P0 = PortNumber.portNumber(0);
 
+    protected static final LinkWeigher DEFAULT_WEIGHER =
+            adapt(new HopCountLinkWeight());
+
     protected TopologyService topologyService;
 
     protected HostService hostService;
 
     @Override
     public Set<Path> getPaths(ElementId src, ElementId dst, LinkWeight weight) {
+        return getPaths(src, dst, adapt(weight));
+    }
+
+    @Override
+    public Set<Path> getPaths(ElementId src, ElementId dst, LinkWeigher weigher) {
         checkNotNull(src, ELEMENT_ID_NULL);
         checkNotNull(dst, ELEMENT_ID_NULL);
 
+        LinkWeigher internalWeigher = weigher != null ? weigher : DEFAULT_WEIGHER;
+
         // Get the source and destination edge locations
         EdgeLink srcEdge = getEdgeLink(src, true);
         EdgeLink dstEdge = getEdgeLink(dst, false);
@@ -80,24 +92,30 @@
         // If the source and destination are on the same edge device, there
         // is just one path, so build it and return it.
         if (srcDevice.equals(dstDevice)) {
-            return edgeToEdgePaths(srcEdge, dstEdge);
+            return edgeToEdgePaths(srcEdge, dstEdge, internalWeigher);
         }
 
         // Otherwise get all paths between the source and destination edge
         // devices.
         Topology topology = topologyService.currentTopology();
-        Set<Path> paths = weight == null ?
-                topologyService.getPaths(topology, srcDevice, dstDevice) :
-                topologyService.getPaths(topology, srcDevice, dstDevice, weight);
+        Set<Path> paths = topologyService.getPaths(topology, srcDevice,
+                dstDevice, internalWeigher);
 
-        return edgeToEdgePaths(srcEdge, dstEdge, paths);
+        return edgeToEdgePaths(srcEdge, dstEdge, paths, internalWeigher);
     }
 
     @Override
     public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst, LinkWeight weight) {
+        return getDisjointPaths(src, dst, adapt(weight));
+    }
+
+    @Override
+    public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst, LinkWeigher weigher) {
         checkNotNull(src, ELEMENT_ID_NULL);
         checkNotNull(dst, ELEMENT_ID_NULL);
 
+        LinkWeigher internalWeigher = weigher != null ? weigher : DEFAULT_WEIGHER;
+
         // Get the source and destination edge locations
         EdgeLink srcEdge = getEdgeLink(src, true);
         EdgeLink dstEdge = getEdgeLink(dst, false);
@@ -113,25 +131,32 @@
         // If the source and destination are on the same edge device, there
         // is just one path, so build it and return it.
         if (srcDevice.equals(dstDevice)) {
-            return edgeToEdgePathsDisjoint(srcEdge, dstEdge);
+            return edgeToEdgePathsDisjoint(srcEdge, dstEdge, internalWeigher);
         }
 
         // Otherwise get all paths between the source and destination edge
         // devices.
         Topology topology = topologyService.currentTopology();
-        Set<DisjointPath> paths = weight == null ?
-                topologyService.getDisjointPaths(topology, srcDevice, dstDevice) :
-                topologyService.getDisjointPaths(topology, srcDevice, dstDevice, weight);
+        Set<DisjointPath> paths = topologyService.getDisjointPaths(topology,
+                srcDevice, dstDevice, internalWeigher);
 
-        return edgeToEdgePathsDisjoint(srcEdge, dstEdge, paths);
+        return edgeToEdgePathsDisjoint(srcEdge, dstEdge, paths, internalWeigher);
     }
 
     @Override
     public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst, LinkWeight weight,
                                               Map<Link, Object> riskProfile) {
+        return getDisjointPaths(src, dst, adapt(weight), riskProfile);
+    }
+
+    @Override
+    public Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst,
+                                              LinkWeigher weigher, Map<Link, Object> riskProfile) {
         checkNotNull(src, ELEMENT_ID_NULL);
         checkNotNull(dst, ELEMENT_ID_NULL);
 
+        LinkWeigher internalWeigher = weigher != null ? weigher : DEFAULT_WEIGHER;
+
         // Get the source and destination edge locations
         EdgeLink srcEdge = getEdgeLink(src, true);
         EdgeLink dstEdge = getEdgeLink(dst, false);
@@ -147,17 +172,16 @@
         // If the source and destination are on the same edge device, there
         // is just one path, so build it and return it.
         if (srcDevice.equals(dstDevice)) {
-            return edgeToEdgePathsDisjoint(srcEdge, dstEdge);
+            return edgeToEdgePathsDisjoint(srcEdge, dstEdge, internalWeigher);
         }
 
         // Otherwise get all paths between the source and destination edge
         // devices.
         Topology topology = topologyService.currentTopology();
-        Set<DisjointPath> paths = weight == null ?
-                topologyService.getDisjointPaths(topology, srcDevice, dstDevice, riskProfile) :
-                topologyService.getDisjointPaths(topology, srcDevice, dstDevice, weight, riskProfile);
+        Set<DisjointPath> paths = topologyService.getDisjointPaths(topology,
+                srcDevice, dstDevice, internalWeigher, riskProfile);
 
-        return edgeToEdgePathsDisjoint(srcEdge, dstEdge, paths);
+        return edgeToEdgePathsDisjoint(srcEdge, dstEdge, paths, internalWeigher);
     }
 
     // Finds the host edge link if the element ID is a host id of an existing
@@ -178,61 +202,63 @@
 
     // Produces a set of edge-to-edge paths using the set of infrastructure
     // paths and the given edge links.
-    private Set<Path> edgeToEdgePaths(EdgeLink srcLink, EdgeLink dstLink) {
+    private Set<Path> edgeToEdgePaths(EdgeLink srcLink, EdgeLink dstLink, LinkWeigher weigher) {
         Set<Path> endToEndPaths = Sets.newHashSetWithExpectedSize(1);
-        endToEndPaths.add(edgeToEdgePath(srcLink, dstLink, null));
+        endToEndPaths.add(edgeToEdgePath(srcLink, dstLink, null, weigher));
         return endToEndPaths;
     }
 
     // Produces a set of edge-to-edge paths using the set of infrastructure
     // paths and the given edge links.
-    private Set<Path> edgeToEdgePaths(EdgeLink srcLink, EdgeLink dstLink, Set<Path> paths) {
+    private Set<Path> edgeToEdgePaths(EdgeLink srcLink, EdgeLink dstLink, Set<Path> paths,
+                                      LinkWeigher weigher) {
         Set<Path> endToEndPaths = Sets.newHashSetWithExpectedSize(paths.size());
         for (Path path : paths) {
-            endToEndPaths.add(edgeToEdgePath(srcLink, dstLink, path));
+            endToEndPaths.add(edgeToEdgePath(srcLink, dstLink, path, weigher));
         }
         return endToEndPaths;
     }
 
-    private Set<DisjointPath> edgeToEdgePathsDisjoint(EdgeLink srcLink, EdgeLink dstLink) {
+    private Set<DisjointPath> edgeToEdgePathsDisjoint(EdgeLink srcLink, EdgeLink dstLink, LinkWeigher weigher) {
         Set<DisjointPath> endToEndPaths = Sets.newHashSetWithExpectedSize(1);
-        endToEndPaths.add(edgeToEdgePathD(srcLink, dstLink, null));
+        endToEndPaths.add(edgeToEdgePathD(srcLink, dstLink, null, weigher));
         return endToEndPaths;
     }
 
     private Set<DisjointPath> edgeToEdgePathsDisjoint(EdgeLink srcLink, EdgeLink dstLink,
-                                                             Set<DisjointPath> paths) {
+                                                             Set<DisjointPath> paths, LinkWeigher weigher) {
         Set<DisjointPath> endToEndPaths = Sets.newHashSetWithExpectedSize(paths.size());
         for (DisjointPath path : paths) {
-            endToEndPaths.add(edgeToEdgePathD(srcLink, dstLink, path));
+            endToEndPaths.add(edgeToEdgePathD(srcLink, dstLink, path, weigher));
         }
         return endToEndPaths;
     }
 
     // Produces a direct edge-to-edge path.
-    private Path edgeToEdgePath(EdgeLink srcLink, EdgeLink dstLink, Path path) {
+    private Path edgeToEdgePath(EdgeLink srcLink, EdgeLink dstLink, Path path, LinkWeigher weigher) {
         List<Link> links = Lists.newArrayListWithCapacity(2);
-        double cost = 0;
+        Weight cost = weigher.getInitialWeight();
 
         // Add source and destination edge links only if they are real and
         // add the infrastructure path only if it is not null.
         if (srcLink != NOT_HOST) {
             links.add(srcLink);
-            cost++;
+            cost = cost.merge(weigher.weight(new DefaultTopologyEdge(null, null, srcLink)));
         }
         if (path != null) {
             links.addAll(path.links());
-            cost += path.cost();
+            cost = cost.merge(path.weight());
         }
         if (dstLink != NOT_HOST) {
             links.add(dstLink);
-            cost++;
+            cost = cost.merge(weigher.weight(new DefaultTopologyEdge(null, null, srcLink)));
         }
         return new DefaultPath(PID, links, cost);
     }
 
     // Produces a direct edge-to-edge path.
-    private DisjointPath edgeToEdgePathD(EdgeLink srcLink, EdgeLink dstLink, DisjointPath path) {
+    private DisjointPath edgeToEdgePathD(EdgeLink srcLink, EdgeLink dstLink, DisjointPath path,
+                                         LinkWeigher weigher) {
         Path primary = null;
         Path backup = null;
         if (path != null) {
@@ -240,10 +266,12 @@
             backup = path.backup();
         }
         if (backup == null) {
-        return new DefaultDisjointPath(PID, (DefaultPath) edgeToEdgePath(srcLink, dstLink, primary));
+        return new DefaultDisjointPath(PID,
+                (DefaultPath) edgeToEdgePath(srcLink, dstLink, primary, weigher));
         }
-        return new DefaultDisjointPath(PID, (DefaultPath) edgeToEdgePath(srcLink, dstLink, primary),
-                                       (DefaultPath) edgeToEdgePath(srcLink, dstLink, backup));
+        return new DefaultDisjointPath(PID,
+                (DefaultPath) edgeToEdgePath(srcLink, dstLink, primary, weigher),
+                (DefaultPath) edgeToEdgePath(srcLink, dstLink, backup, weigher));
     }
 
 
diff --git a/core/api/src/main/java/org/onosproject/net/topology/AdapterLinkWeigher.java b/core/api/src/main/java/org/onosproject/net/topology/AdapterLinkWeigher.java
new file mode 100644
index 0000000..1bb2729
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/topology/AdapterLinkWeigher.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.net.topology;
+
+import org.onlab.graph.DefaultEdgeWeigher;
+import org.onlab.graph.ScalarWeight;
+import org.onlab.graph.Weight;
+
+/**
+ * Wrapper which transforms double-based link weigher to {@link Weight}-based
+ * link weigher.
+ */
+public final class AdapterLinkWeigher
+        extends DefaultEdgeWeigher<TopologyVertex, TopologyEdge>
+        implements LinkWeigher {
+
+    private final LinkWeight doubleWeigher;
+
+    private AdapterLinkWeigher(LinkWeight doubleWeigher) {
+        this.doubleWeigher = doubleWeigher;
+    }
+
+    @Override
+    public Weight weight(TopologyEdge edge) {
+        return new ScalarWeight(doubleWeigher.weight(edge));
+    }
+
+    /**
+     * Transforms double-based link weigher to {@link Weight}-based weigher.
+     *
+     * @param lw double-based weigher
+     * @return {@link Weight}-based weigher
+     */
+    public static LinkWeigher adapt(LinkWeight lw) {
+        return lw == null ? null : new AdapterLinkWeigher(lw);
+    }
+}
diff --git a/core/api/src/main/java/org/onosproject/net/topology/LinkWeigher.java b/core/api/src/main/java/org/onosproject/net/topology/LinkWeigher.java
new file mode 100644
index 0000000..9008811
--- /dev/null
+++ b/core/api/src/main/java/org/onosproject/net/topology/LinkWeigher.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.net.topology;
+
+import org.onlab.graph.EdgeWeigher;
+
+/**
+ * Entity capable of determining cost or weight of a specified topology
+ * graph edge. Returns {@link org.onlab.graph.Weight} instances.
+ */
+public interface LinkWeigher extends EdgeWeigher<TopologyVertex, TopologyEdge> {
+}
diff --git a/core/api/src/main/java/org/onosproject/net/topology/LinkWeight.java b/core/api/src/main/java/org/onosproject/net/topology/LinkWeight.java
index 99fa38c..22eb7d1 100644
--- a/core/api/src/main/java/org/onosproject/net/topology/LinkWeight.java
+++ b/core/api/src/main/java/org/onosproject/net/topology/LinkWeight.java
@@ -15,11 +15,19 @@
  */
 package org.onosproject.net.topology;
 
-import org.onlab.graph.EdgeWeight;
-
 /**
  * Entity capable of determining cost or weight of a specified topology
  * graph edge.
+ * @deprecated in Junco (1.9.0), use {@link LinkWeigher} instead
  */
-public interface LinkWeight extends EdgeWeight<TopologyVertex, TopologyEdge> {
+@Deprecated
+public interface LinkWeight {
+
+    /**
+     * Returns the weight of the given edge.
+     *
+     * @param edge edge to be weighed
+     * @return edge weight
+     */
+    double weight(TopologyEdge edge);
 }
diff --git a/core/api/src/main/java/org/onosproject/net/topology/PathAdminService.java b/core/api/src/main/java/org/onosproject/net/topology/PathAdminService.java
index 0214e57..d88d729 100644
--- a/core/api/src/main/java/org/onosproject/net/topology/PathAdminService.java
+++ b/core/api/src/main/java/org/onosproject/net/topology/PathAdminService.java
@@ -29,10 +29,22 @@
      * used.
      *
      * @param linkWeight default link-weight function
+     *
+     * @deprecated in Junco (1.9.0), use setDefaultLinkWeigher() instead
      */
+    @Deprecated
     void setDefaultLinkWeight(LinkWeight linkWeight);
 
     /**
+     * Sets the specified link-weight function to be used as a default.
+     * If null is specified, the builtin default hop-count link-weight will be
+     * used.
+     *
+     * @param linkWeigher link-weight function to be used as default
+     */
+    void setDefaultLinkWeigher(LinkWeigher linkWeigher);
+
+    /**
      * Sets the specified graph path search algorightm to be used as a default.
      * If null is specified, the builtin default all-shortest-paths Dijkstra
      * algorithm will be used.
diff --git a/core/api/src/main/java/org/onosproject/net/topology/PathService.java b/core/api/src/main/java/org/onosproject/net/topology/PathService.java
index 6ed4799..adfca3d 100644
--- a/core/api/src/main/java/org/onosproject/net/topology/PathService.java
+++ b/core/api/src/main/java/org/onosproject/net/topology/PathService.java
@@ -49,10 +49,25 @@
      * @param dst    destination element
      * @param weight edge-weight entity
      * @return set of all shortest paths between the two element
+     *
+     * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
      */
+    @Deprecated
     Set<Path> getPaths(ElementId src, ElementId dst, LinkWeight weight);
 
     /**
+     * Returns the set of all shortest paths between the specified source and
+     * destination network elements.  The path is computed using the supplied
+     * edge-weight function.
+     *
+     * @param src     source element
+     * @param dst     destination element
+     * @param weigher edge-weight entity
+     * @return set of all shortest paths between the two element
+     */
+    Set<Path> getPaths(ElementId src, ElementId dst, LinkWeigher weigher);
+
+    /**
      * Returns the set of all disjoint shortest path pairs between the
      * specified source and destination elements. The path is computed using
      * the default edge-weight function, which by default is hop-count.
@@ -72,12 +87,28 @@
      * @param dst    destination device
      * @param weight edge-weight entity
      * @return set of all shortest paths between the two devices
+     *
+     * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
      */
+    @Deprecated
     Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst,
                                        LinkWeight weight);
 
     /**
      * Returns the set of all disjoint shortest path pairs between the
+     * specified source and destination elements. The path is computed using
+     * the supplied edge-weight function.
+     *
+     * @param src     source device
+     * @param dst     destination device
+     * @param weigher edge-weight entity
+     * @return set of all shortest paths between the two devices
+     */
+    Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst,
+                                       LinkWeigher weigher);
+
+    /**
+     * Returns the set of all disjoint shortest path pairs between the
      * specified source and destination elements and taking into consideration
      * the provided risk profile. The path is computed using the default
      * edge-weight function, which by default is hop-count.
@@ -101,9 +132,28 @@
      * @param weight      edge-weight entity
      * @param riskProfile map of edges to risk profiles
      * @return set of all shortest paths between the two devices
+     *
+     * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
      */
+    @Deprecated
     Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst,
                                        LinkWeight weight,
                                        Map<Link, Object> riskProfile);
 
+    /**
+     * Returns the set of all disjoint shortest path pairs between the
+     * specified source and destination elements and taking into consideration
+     * the provided risk profile. The path is computed using the supplied
+     * edge-weight function.
+     *
+     * @param src         source device
+     * @param dst         destination device
+     * @param weigher     edge-weight entity
+     * @param riskProfile map of edges to risk profiles
+     * @return set of all shortest paths between the two devices
+     */
+    Set<DisjointPath> getDisjointPaths(ElementId src, ElementId dst,
+                                       LinkWeigher weigher,
+                                       Map<Link, Object> riskProfile);
+
 }
diff --git a/core/api/src/main/java/org/onosproject/net/topology/TopologyService.java b/core/api/src/main/java/org/onosproject/net/topology/TopologyService.java
index e4504c5..13d1842 100644
--- a/core/api/src/main/java/org/onosproject/net/topology/TopologyService.java
+++ b/core/api/src/main/java/org/onosproject/net/topology/TopologyService.java
@@ -109,11 +109,27 @@
      * @param dst      destination device
      * @param weight   edge-weight entity
      * @return set of all shortest paths between the two devices
+     *
+     * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
      */
+    @Deprecated
     Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
                        LinkWeight weight);
 
     /**
+     * Returns the set of all shortest paths, computed using the supplied
+     * edge-weight entity, between the specified source and destination devices.
+     *
+     * @param topology topology descriptor
+     * @param src      source device
+     * @param dst      destination device
+     * @param weigher  edge-weight entity
+     * @return set of all shortest paths between the two devices
+     */
+    Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
+                       LinkWeigher weigher);
+
+    /**
      * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count,
      * between the specified source and destination devices.
      *
@@ -133,11 +149,27 @@
      * @param dst      destination device
      * @param weight   edge-weight entity
      * @return set of all shortest paths between the two devices
+     *
+     * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
      */
+    @Deprecated
     Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
                                        LinkWeight weight);
 
     /**
+     * Returns the set of all disjoint shortest path pairs, computed using the supplied
+     * edge-weight entity, between the specified source and destination devices.
+     *
+     * @param topology topology descriptor
+     * @param src      source device
+     * @param dst      destination device
+     * @param weigher  edge-weight entity
+     * @return set of all shortest paths between the two devices
+     */
+    Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
+                                       LinkWeigher weigher);
+
+    /**
      * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count,
      * between the specified source and destination devices.
      *
@@ -160,11 +192,28 @@
      * @param weight      edge-weight entity
      * @param riskProfile map of edges to risk profiles
      * @return set of all shortest paths between the two devices
+     *
+     * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
      */
+    @Deprecated
     Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
                                        LinkWeight weight, Map<Link, Object> riskProfile);
 
     /**
+     * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count,
+     * between the specified source and destination devices.
+     *
+     * @param topology    topology descriptor
+     * @param src         source device
+     * @param dst         destination device
+     * @param weigher     edge-weight entity
+     * @param riskProfile map of edges to risk profiles
+     * @return set of all shortest paths between the two devices
+     */
+    Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
+                                       LinkWeigher weigher, Map<Link, Object> riskProfile);
+
+    /**
      * Indicates whether the specified connection point is part of the network
      * infrastructure or part of network edge.
      *
diff --git a/core/api/src/main/java/org/onosproject/net/topology/TopologyStore.java b/core/api/src/main/java/org/onosproject/net/topology/TopologyStore.java
index 61ab526..907beb2 100644
--- a/core/api/src/main/java/org/onosproject/net/topology/TopologyStore.java
+++ b/core/api/src/main/java/org/onosproject/net/topology/TopologyStore.java
@@ -109,11 +109,26 @@
      * @param dst      destination device
      * @param weight   link weight function
      * @return set of shortest paths
+     *
+     * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
      */
+    @Deprecated
     Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
                        LinkWeight weight);
 
     /**
+     * Computes and returns the set of shortest paths between src and dest.
+     *
+     * @param topology topology descriptor
+     * @param src      source device
+     * @param dst      destination device
+     * @param weigher  link weight function
+     * @return set of shortest paths
+     */
+    Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
+                       LinkWeigher weigher);
+
+    /**
      * Computes and returns the set of disjoint shortest path pairs
      * between src and dst.
      *
@@ -122,7 +137,10 @@
      * @param dst      destination device
      * @param weight   link weight function
      * @return set of shortest paths
+     *
+     * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
      */
+    @Deprecated
     Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
                                        LinkWeight weight);
 
@@ -133,6 +151,19 @@
      * @param topology topology descriptor
      * @param src      source device
      * @param dst      destination device
+     * @param weigher  link weight function
+     * @return set of shortest paths
+     */
+    Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
+                                       LinkWeigher weigher);
+
+    /**
+     * Computes and returns the set of disjoint shortest path pairs
+     * between src and dst.
+     *
+     * @param topology topology descriptor
+     * @param src      source device
+     * @param dst      destination device
      * @return set of shortest paths
      */
     Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst);
@@ -141,24 +172,42 @@
      * Computes and returns the set of SRLG disjoint shortest path pairs between source
      * and dst, given a mapping of edges to SRLG risk groups.
      *
-     * @param topology topology descriptor
-     * @param src      source device
-     * @param dst      destination device
-     * @param weight   link weight function
-     * @param riskProfile   map of edges to objects. Edges that map to the same object will
+     * @param topology    topology descriptor
+     * @param src         source device
+     * @param dst         destination device
+     * @param weight      link weight function
+     * @param riskProfile map of edges to objects. Edges that map to the same object will
      * be treated as if they were in the same risk group.
      * @return set of shortest paths
+     *
+     * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
      */
+    @Deprecated
     Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
                                        LinkWeight weight, Map<Link, Object> riskProfile);
 
     /**
+     * Computes and returns the set of SRLG disjoint shortest path pairs between source
+     * and dst, given a mapping of edges to SRLG risk groups.
+     *
+     * @param topology    topology descriptor
+     * @param src         source device
+     * @param dst         destination device
+     * @param weigher     link weight function
+     * @param riskProfile map of edges to objects. Edges that map to the same object will
+     * be treated as if they were in the same risk group.
+     * @return set of shortest paths
+     */
+    Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
+                                       LinkWeigher weigher, Map<Link, Object> riskProfile);
+
+    /**
      * Returns the set of pre-computed SRLG shortest paths between src and dest.
      *
-     * @param topology topology descriptor
-     * @param src      source device
-     * @param dst      destination device
-     * @param riskProfile   map of edges to objects. Edges that map to the same object will
+     * @param topology    topology descriptor
+     * @param src         source device
+     * @param dst         destination device
+     * @param riskProfile map of edges to objects. Edges that map to the same object will
      * be treated as if they were in the same risk group.
      * @return set of shortest paths
      */