org.psjava.ds.graph.DirectedGraphFromUndirected 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.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