public ProcessEdge getEdge( Process sourceVertex, Process targetVertex ) { return graph.getEdge( sourceVertex, targetVertex ); }
if (graph.getEdge(v1, v3) != null) {
/** * Report the inter-chord relationship, if any, that exists within the ordered pair * of chords * * @param from source chord * @param to target chord * @return the relationship from source to target, if any */ private Rel getRel (AbstractChordInter from, AbstractChordInter to) { Edge edge = graph.getEdge(from, to); if (edge != null) { return edge.rel; } return null; }
public Path getEdge( ElementGraph parent, ElementGraph child ) { return graph.getEdge( new Delegate( parent ), new Delegate( child ) ); }
/** * Store the relationship between a source and a target chord * * @param from source chord * @param to target chord * @param rel the relationship value */ private void setRel (AbstractChordInter from, AbstractChordInter to, Rel rel) { Edge edge = graph.getEdge(from, to); if (edge != null) { edge.rel = rel; } else { graph.addEdge(from, to, new Edge(rel)); } }
result.addVertex( "b" ); result.addVertex( "c" ); result.addEdge( "B", "A", full.getEdge( "B", "A" ) ); result.addEdge( "1", "0", full.getEdge( "1", "0" ) ); result.addEdge( "0", "c", full.getEdge( "0", "c" ) ); result.addEdge( "A", "a", full.getEdge( "A", "a" ) ); result.addEdge( "a", "b", full.getEdge( "a", "b" ) ); result.addEdge( "b", "c", full.getEdge( "b", "c" ) );
@Test public void testFindSubGraph2() { SimpleDirectedGraph<String, Object> full = new SimpleDirectedGraph<>( Object.class ); full.addVertex( "1" ); full.addVertex( "0" ); full.addVertex( "a" ); full.addVertex( "b" ); full.addVertex( "c" ); full.addVertex( "d" ); full.addVertex( "e" ); full.addEdge( "a", "b" ); full.addEdge( "b", "c" ); full.addEdge( "c", "d" ); full.addEdge( "c", "e" ); full.addEdge( "1", "0" ); full.addEdge( "0", "c" ); SimpleDirectedGraph<String, Object> contracted = new SimpleDirectedGraph<>( Object.class ); contracted.addVertex( "a" ); contracted.addVertex( "c" ); contracted.addEdge( "a", "c" ); SimpleDirectedGraph<String, Object> result = new SimpleDirectedGraph<>( Object.class ); result.addVertex( "a" ); result.addVertex( "b" ); result.addVertex( "c" ); result.addEdge( "a", "b", full.getEdge( "a", "b" ) ); result.addEdge( "b", "c", full.getEdge( "b", "c" ) ); assertGraphs( full, contracted, result ); }