org.psjava.ds.graph.MutableDirectedWeightedGraph Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of psjava Show documentation
Show all versions of psjava Show documentation
Problem Solving Library for Java
The newest version!
package org.psjava.ds.graph;
import org.psjava.ds.Collection;
public class MutableDirectedWeightedGraph implements Graph> {
public static MutableDirectedWeightedGraph create() {
return new MutableDirectedWeightedGraph();
}
private MutableDirectedGraph> g = MutableDirectedGraph.create();
public void insertVertex(V v) {
g.insertVertex(v);
}
public void addEdge(V from, V to, W weight) {
g.addEdge(SimpleDirectedWeightedEdge.create(from, to, weight));
}
@Override
public Collection getVertices() {
return g.getVertices();
}
@Override
public Iterable> getEdges(V v) {
return g.getEdges(v);
}
@Override
public String toString() {
return g.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy