org.psjava.ds.graph.MutableCapacityGraph 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
package org.psjava.ds.graph;
import org.psjava.ds.Collection;
public class MutableCapacityGraph implements Graph> {
public static MutableCapacityGraph create() {
return new MutableCapacityGraph();
}
private final MutableGraph> g = MutableGraph.create();
@Override
public Iterable> getEdges() {
return g.getEdges();
}
@Override
public Collection getVertices() {
return g.getVertices();
}
public void insertVertex(V v) {
g.insertVertex(v);
}
public void addEdge(V from, V to, F capacity) {
g.addEdge(SimpleCapacityEdge.create(from, to, capacity));
}
@Override
public String toString() {
return GraphToString.toString(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy