All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.psjava.ds.graph.MutableDirectedWeightedGraph Maven / Gradle / Ivy

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