Refactoring

* package refactoring
* new matrix implementation (todo)
* new adj list implemetation (todo)
* fixed tests
This commit is contained in:
2019-06-15 15:15:13 +02:00
parent a8596331e7
commit 0de35fd4a1
35 changed files with 772 additions and 118 deletions

View File

@@ -0,0 +1,29 @@
package berack96.lib.graph.visit;
import java.util.List;
import berack96.lib.graph.Edge;
import berack96.lib.graph.Graph;
/**
* Interface that is helpful for implements visit that needs to retrieve the distance between a vertex to all the others
*
* @param <V> the vertex
* @param <W> the weight
* @author Berack96
*/
public interface VisitDistSourceDest<V, W extends Number> extends VisitStrategy<V, W> {
/**
* Get the distance from the source to the destination<br>
* The list contains the minimum path from the vertex marked as source to the destination vertex
*
* @param graph the graph were to find the min path
* @param source the source vertex
* @param destination the destination vertex
* @return the distance
* @throws NullPointerException if one of the vertex is null
* @throws IllegalArgumentException if one of the vertex is not contained in the graph
*/
List<Edge<V, W>> distance(Graph<V, W> graph, V source, V destination) throws NullPointerException, IllegalArgumentException;
}