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

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

There is a newer version: 0.1.19
Show newest version
package org.psjava.ds.graph;

import org.psjava.util.DataConverter;

public class DirectedGraphFromUndirected {

	public static > Graph> wrap(final Graph original) {
		return EdgeDoubledGraph.wrap(original, new DataConverter>() {
			@Override
			public DirectedEdge convert(E original) {
				return SimpleDirectedEdge.create(original.v1(), original.v2());
			}
		}, new DataConverter>() {
			@Override
			public DirectedEdge convert(E original) {
				return SimpleDirectedEdge.create(original.v2(), original.v1());
			}
		});
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy