@Override public DirectedGraph<V, E> create() { return new DirectedSparseMultigraph<V, E>(); } };
@Override public DirectedSparseMultigraph<V, E> newInstance() { return new DirectedSparseMultigraph<V, E>(); } }
public DirectedGraph<String, Integer> get() { return new DirectedSparseMultigraph<String,Integer>(); } };
public DirectedGraph<String, Integer> get() { return new DirectedSparseMultigraph<String,Integer>(); } };
public DirectedGraph<String, Integer> get() { return new DirectedSparseMultigraph<String,Integer>(); } };
public DirectedGraph<String, Integer> get() { return new DirectedSparseMultigraph<String,Integer>(); } };
public DirectedGraph<V,E> get() { return new DirectedSparseMultigraph<V,E>(); } };
/** * Returns a {@code Factory} that creates an instance of this graph type. * * @param <V> * the vertex type for the graph factory * @param <E> * the edge type for the graph factory */ public static <V, E> Factory<DirectedGraph<V, E>> getFactory() { return new Factory<DirectedGraph<V, E>>() { @Override public DirectedGraph<V, E> create() { return new DirectedSparseMultigraph<V, E>(); } }; }
@Override public Tree<V, E> create() { return new DelegateTree<V, E>( new DirectedSparseMultigraph<V, E>()); } };
public Tree<V,E> get() { return new DelegateTree<V,E>(new DirectedSparseMultigraph<V,E>()); } };
public NetworkGraphManager() { networkGraph = new DirectedSparseMultigraph<>(); shortestPath = new DijkstraShortestPath<>(networkGraph); observers = new ArrayList<>(); }
public void restrictRelationshipMembership( final Collection<ProjectRelationship<?, ?>> rels ) { graph = new DirectedSparseMultigraph<ProjectVersionRef, ProjectRelationship<?, ?>>(); incompleteSubgraphs.clear(); variableSubgraphs.clear(); addRelationships( rels.toArray( new ProjectRelationship<?, ?>[rels.size()] ) ); recomputeIncompleteSubgraphs(); }
int maxNodesPerLayer, double linkprob) { DirectedGraph<String, Number> dag = new DirectedSparseMultigraph<String, Number>(); Set<String> previousLayers = new HashSet<String>(); Set<String> inThisLayer = new HashSet<String>();
double linkprob) { DirectedGraph<String,Number> dag = new DirectedSparseMultigraph<String,Number>(); Set<String> previousLayers = new HashSet<String>(); Set<String> inThisLayer = new HashSet<String>();
/** * Creates a small sample graph that can be used for testing purposes. The * graph is as described in the section on {@link #pairs pairs}. If * <code>isDirected</code>, the graph is a {@link DirectedSparseMultigraph * DirectedSparseMultigraph}, otherwise, it is an * {@link UndirectedSparseMultigraph UndirectedSparseMultigraph}. * * @return a graph consisting of eight edges and ten nodes. */ public static Graph<String, Number> createTestGraph(boolean directed) { Graph<String, Number> graph = null; if (directed) { graph = new DirectedSparseMultigraph<String, Number>(); } else { graph = new UndirectedSparseMultigraph<String, Number>(); } for (int i = 0; i < pairs.length; i++) { String[] pair = pairs[i]; graph.addEdge(Integer.parseInt(pair[2]), pair[0], pair[1]); } return graph; }
/** * Creates a small sample graph that can be used for testing purposes. The * graph is as described in the section on {@link #pairs pairs}. If <code>isDirected</code>, * the graph is a {@link DirectedSparseMultigraph DirectedSparseMultigraph}, * otherwise, it is an {@link UndirectedSparseMultigraph UndirectedSparseMultigraph}. * * @param directed true iff the graph created is to have directed edges * @return a graph consisting of eight edges and ten nodes. */ public static Graph<String, Number> createTestGraph(boolean directed) { Graph<String, Number> graph = null; if(directed) { graph = new DirectedSparseMultigraph<String,Number>(); } else { graph = new UndirectedSparseMultigraph<String,Number>(); } for (int i = 0; i < pairs.length; i++) { String[] pair = pairs[i]; graph.addEdge(Integer.parseInt(pair[2]), pair[0], pair[1]); } return graph; }
graph = new DirectedSparseMultigraph<StateImplementation, TransitionImplementationInstance>(); // the new graph
graph = new DirectedSparseMultigraph<String, Number>(); String[] v = createVertices(10); createEdges(v);
/** * Create the default graph representation of a transformation graph. The * default graph is an overview without the IN- and OUT-nodes. * * @param graph * the graph to represent * @return the representation */ public static Graph<BoostedNode, String> createOverviewDirectedGraph( TransformationGraph graph) { DirectedSparseMultigraph<BoostedNode, String> result = new DirectedSparseMultigraph<>(); Set<BoostedNode> nodes = BoostedNodeUtils.getAllNodesOfGraph(graph .getRootOfGraph()); // add the nodes for (BoostedNode node : nodes) { result.addVertex(node); } // add edges between nodes for (BoostedNode node : nodes) { for (BoostedNode outPoint : node.getOutPoints()) { for (BoostedNode inPoint : node.getSuccessorInPoints(outPoint)) result.addEdge(new UID().toString(), node, inPoint .getZoomOut(null).getKey()); } // out points are sufficient, otherwise all edges would be // duplicated } return result; }
public static <N, E> DirectedGraph<NodeVisualization, EdgeVisualization> createVisualizationGraph(Graph<N, E> graph, List<VisualizationHelper<N, ? super E>> helpers) { final VisualizationHelper<N, E> helper = new AggregateVisualizationHelper<>(helpers); Map<String, String> defaultProps = new HashMap<>(); helper.getGlobalNodeProperties(defaultProps); DirectedGraph<NodeVisualization, EdgeVisualization> jungGraph = new DirectedSparseMultigraph<>(); MutableMapping<N, NodeVisualization> mapping = graph.createStaticNodeMapping(); NodeIDs<N> nodeIds = graph.nodeIDs(); for (N node : graph) { int id = nodeIds.getNodeId(node); Map<String, String> props = new HashMap<>(defaultProps); helper.getNodeProperties(node, props); NodeVisualization vis = createNodeVisualization(props, id); mapping.put(node, vis); } defaultProps = new HashMap<>(); helper.getGlobalEdgeProperties(defaultProps); for (N node : graph) { NodeVisualization srcVis = mapping.get(node); for (E edge : graph.getOutgoingEdges(node)) { N target = graph.getTarget(edge); NodeVisualization tgtVis = mapping.get(target); Map<String, String> props = new HashMap<>(defaultProps); helper.getEdgeProperties(node, edge, target, props); EdgeVisualization edgeVis = createEdgeVisualization(props); jungGraph.addEdge(edgeVis, srcVis, tgtVis); } } return jungGraph; }