diff --git a/jgalgo-bench/src/main/java/com/jgalgo/bench/impls/ShortestPathStBench.java b/jgalgo-bench/src/main/java/com/jgalgo/bench/impls/ShortestPathStBench.java index 1bfc23353..1f7c46264 100644 --- a/jgalgo-bench/src/main/java/com/jgalgo/bench/impls/ShortestPathStBench.java +++ b/jgalgo-bench/src/main/java/com/jgalgo/bench/impls/ShortestPathStBench.java @@ -39,6 +39,7 @@ import com.jgalgo.alg.path.ShortestPathHeuristicSt; import com.jgalgo.alg.path.ShortestPathSingleSource; import com.jgalgo.alg.path.ShortestPathSt; +import com.jgalgo.alg.path.ShortestPathStBidirectionalDijkstra; import com.jgalgo.bench.util.BenchUtils; import com.jgalgo.bench.util.GraphsTestUtils; import com.jgalgo.bench.util.TestUtils.SeedGenerator; @@ -109,7 +110,7 @@ public void setup() { @Benchmark public void BidirectionalDijkstra(Blackhole blackhole) { - benchStShortestPath(ShortestPathSt.builder().build(), blackhole); + benchStShortestPath(new ShortestPathStBidirectionalDijkstra(), blackhole); } @Benchmark @@ -151,7 +152,7 @@ public void setup() { @Benchmark public void BidirectionalDijkstra(Blackhole blackhole) { - benchStShortestPath(ShortestPathSt.builder().build(), blackhole); + benchStShortestPath(new ShortestPathStBidirectionalDijkstra(), blackhole); } @Benchmark @@ -194,7 +195,7 @@ public void setup() { @Benchmark public void BidirectionalDijkstra(Blackhole blackhole) { - benchStShortestPath(ShortestPathSt.builder().build(), blackhole); + benchStShortestPath(new ShortestPathStBidirectionalDijkstra(), blackhole); } @Benchmark diff --git a/jgalgo-core/src/main/java/com/jgalgo/alg/path/ShortestPathSt.java b/jgalgo-core/src/main/java/com/jgalgo/alg/path/ShortestPathSt.java index f78271c9a..6914b8775 100644 --- a/jgalgo-core/src/main/java/com/jgalgo/alg/path/ShortestPathSt.java +++ b/jgalgo-core/src/main/java/com/jgalgo/alg/path/ShortestPathSt.java @@ -15,7 +15,6 @@ */ package com.jgalgo.alg.path; -import com.jgalgo.alg.AlgorithmBuilderBase; import com.jgalgo.graph.Graph; import com.jgalgo.graph.IWeightFunction; import com.jgalgo.graph.IntGraph; @@ -36,8 +35,7 @@ * A variant with a heuristic distance function is also available, see {@link ShortestPathHeuristicSt}. * *
- * Use {@link #newInstance()} to get a default implementation of this interface. A builder obtained via
- * {@link #builder()} may support different options to obtain different implementations.
+ * Use {@link #newInstance()} to get a default implementation of this interface.
*
* @see ShortestPathSingleSource
* @see ShortestPathAllPairs
@@ -89,56 +87,25 @@
- * This is the recommended way to instantiate a new {@link ShortestPathSt} object. The
- * {@link ShortestPathSt.Builder} might support different options to obtain different implementations.
+ * This is the recommended way to instantiate a new {@link ShortestPathSt} object.
*
* @return a default implementation of {@link ShortestPathSt}
*/
static ShortestPathSt newInstance() {
- return builder().build();
- }
-
- /**
- * Create a new S-T shortest path algorithm builder.
- *
- *
- * Use {@link #newInstance()} for a default implementation.
- *
- * @return a new builder that can build {@link ShortestPathSt} objects
- */
- static ShortestPathSt.Builder builder() {
- return () -> {
- return new ShortestPathSt() {
- ShortestPathSt cardinalityStSp = new ShortestPathStBidirectionalBfs();
- ShortestPathSt weightedStSp = new ShortestPathStBidirectionalDijkstra();
+ return new ShortestPathSt() {
+ ShortestPathSt cardinalityStSp = new ShortestPathStBidirectionalBfs();
+ ShortestPathSt weightedStSp = new ShortestPathStBidirectionalDijkstra();
- @Override
- public