Interface GraphWeightAdapter<W>
- All Superinterfaces:
Comparator<W>
Adapter for handling generic edge weights in graph algorithms.
Defines the necessary operations (addition, zero, comparison) for algorithms like Dijkstra's shortest path or Minimum Spanning Tree to work with any weight type.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GraphWeightAdapter<Double> Adapter forDouble.static final GraphWeightAdapter<Integer> Adapter forInteger.static final GraphWeightAdapter<Real> Adapter forReal. -
Method Summary
Methods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
Method Details
-
zero
-
add
-
compare
Compares two weights.- Specified by:
comparein interfaceComparator<W>- Parameters:
a- the first weightb- the second weight- Returns:
- negative if a invalid input: '<' b, zero if a = b, positive if a > b
-