edu.uci.ics.jung.graph.Graph.containsEdge()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中edu.uci.ics.jung.graph.Graph.containsEdge()方法的一些代码示例,展示了Graph.containsEdge()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.containsEdge()方法的具体详情如下:
包路径:edu.uci.ics.jung.graph.Graph
类名称:Graph
方法名:containsEdge

Graph.containsEdge介绍

暂无

代码示例

代码示例来源:origin: net.sf.jung/jung-graph-impl

@Override
public int getIncidentCount(E edge)
{
  if (!delegate.containsEdge(edge))
    return 0;
  // all edges in a tree connect exactly 2 vertices
  return 2;
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#containsEdge(java.lang.Object)
 */
public synchronized boolean containsEdge(E edge) {
  return delegate.containsEdge(edge);
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#containsEdge(java.lang.Object)
 */
public boolean containsEdge(E edge) {
  return delegate.containsEdge(edge);
}

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#containsEdge(java.lang.Object)
 */
@Override
public boolean containsEdge(E edge) {
  return delegate.containsEdge(edge);
}

代码示例来源:origin: geogebra/geogebra

@Override
public int getIncidentCount(E edge) {
  if (!delegate.containsEdge(edge)) {
    return 0;
  }
  // all edges in a tree connect exactly 2 vertices
  return 2;
}

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#containsEdge(java.lang.Object)
 */
@Override
public boolean containsEdge(E edge) {
  return delegate.containsEdge(edge);
}

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#containsEdge(java.lang.Object)
 */
@Override
public synchronized boolean containsEdge(E edge) {
  return delegate.containsEdge(edge);
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Hypergraph#containsEdge(java.lang.Object)
 */
public boolean containsEdge(E edge) {
  return delegate.containsEdge(edge);
}

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

/**
 * Returns <code>true</code> if the graph contains the edge.
 * @param edge The edge.
 * @return <code>true</code> if the edge is in the graph.
 */
public boolean containsEdge(Object edge)
{
  return delegate.containsEdge(edge);
}
/**

代码示例来源:origin: net.sf.jung/jung-visualization

public boolean containsEdge(E edge) {
  return graph.containsEdge(edge);
}
public boolean containsVertex(V vertex) {

代码示例来源:origin: iTransformers/netTransformer

public boolean FindEdgeByIDCurrentGraph(String name) {
  if (name != null && !name.isEmpty()) {
    if (currentGraph != null)
      return currentGraph.containsEdge(name);
    else
      return false;
  } else {
    return false;
  }
}

代码示例来源:origin: iTransformers/netTransformer

public boolean FindEdgeByIDEntireGraph(String name) {
  if (name != null && !name.isEmpty()) {
    if (entireGraph != null)
      return entireGraph.containsEdge(name);
    else
      return false;
  } else {
    return false;
  }
}

代码示例来源:origin: girtel/Net2Plan

@Override
  public Double transform(Link edge)
  {
    if (graph.containsEdge(edge))
    {
      if (edge.getId() < 0) throw new RuntimeException("Bad");
      return nev.transform(edge);
    } else if (auxGraph.containsEdge(edge)) { return 1.0; }
    throw new RuntimeException("Bad");
  }
};

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.graphconnectivity

continue;
if (dGraph.containsEdge(edge)) {

代码示例来源:origin: geogebra/geogebra

/**
 * Removes <code>edge</code> from this tree. If <code>remove_subtree</code>
 * is <code>true</code>, removes the subtree rooted at the child vertex
 * incident to <code>edge</code>. Otherwise, leaves the subtree intact as a
 * new component tree of this forest.
 * 
 * @param edge
 *            the edge to remove
 * @param remove_subtree
 *            if <code>true</code>, remove the subtree
 * @return <code>true</code> iff the tree was modified
 */
public boolean removeEdge(E edge, boolean remove_subtree) {
  if (!delegate.containsEdge(edge)) {
    return false;
  }
  V child = getDest(edge);
  if (remove_subtree) {
    return removeVertex(child);
  }
  delegate.removeEdge(edge);
  return false;
}

代码示例来源:origin: girtel/Net2Plan

/** Returns the shortest pair of node-disjoint paths, where each item represents a path. The number of returned items will be equal to the number of paths found: when empty, no path was found; when {@code size()} = 1, only one path was found; and when {@code size()} = 2, the node-disjoint paths were found. Internally it uses the Suurballe-Tarjan algorithm.
 * 
 * @param graph Graph representing the network
 * @param nev Object responsible for returning weights for edges
 * @param originNode Origin node
 * @param destinationNode Origin node
 * @return Shortest pair of node-disjoint paths */
public static List<List<Link>> getTwoNodeDisjointPaths(final Graph<Node, Link> graph, final Transformer<Link, Double> nev, Node originNode, Node destinationNode)
{
  List<List<Link>> nodeDisjointSPs = new LinkedList<List<Link>>();
  if (graph.getVertexCount() < 2 || !graph.containsVertex(originNode) || !graph.containsVertex(destinationNode)) return nodeDisjointSPs;
  Pair<Graph<Node, Link>, Transformer<Link, Double>> aux = buildAuxiliaryNodeDisjointGraph(graph, nev, originNode, destinationNode);
  Graph<Node, Link> auxGraph = aux.getFirst();
  Transformer<Link, Double> auxNev = aux.getSecond();
  nodeDisjointSPs = getTwoLinkDisjointPaths(auxGraph, auxNev, originNode, destinationNode);
  for (List<Link> auxSP : nodeDisjointSPs)
  {
    Iterator<Link> it = auxSP.iterator();
    while (it.hasNext())
    {
      Link edge = it.next();
      if (!graph.containsEdge(edge)) it.remove();
    }
  }
  return nodeDisjointSPs;
}

代码示例来源:origin: net.sf.jung/jung-graph-impl

/**
 * Removes <code>edge</code> from this tree.
 * If <code>remove_subtree</code> is <code>true</code>, removes
 * the subtree rooted at the child vertex incident to <code>edge</code>.
 * Otherwise, leaves the subtree intact as a new component tree of this
 * forest.
 * @param edge the edge to remove
 * @param remove_subtree if <code>true</code>, remove the subtree
 * @return <code>true</code> iff the tree was modified
 */
public boolean removeEdge(E edge, boolean remove_subtree)
{
  if (!delegate.containsEdge(edge))
    return false;
  V child = getDest(edge);
  if (remove_subtree)
    return removeVertex(child);
  else
  {
    delegate.removeEdge(edge);
    return false;
  }
}

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.graphconnectivity

/**
 * Adds stack of edges to a graph
 *
 * @param graph
 *            The graph to modify
 * @param edgeStack
 *            The stack of edges to add
 */
protected void addPath(Graph<String, UnorderedPair<String>> graph,
    Stack<UnorderedPair<String>> edgeStack)
{
  for (UnorderedPair<String> edge : edgeStack) {
    if (graph.containsEdge(edge) == false) {
      graph.addEdge(edge, edge.getFirst(), edge.getSecond());
      if (graphVisualizer != null) {
        graphVisualizer.animate(graph, edge, edge.getFirst(),
            edge.getSecond());
      }
    }
  }
}

代码示例来源:origin: org.opendaylight.controller/routing.dijkstra_implementation

topo.addVertex(dst.getNode());
edgePresentInGraph = topo.containsEdge(edge);
if (edgePresentInGraph == false) {
  try {

代码示例来源:origin: iTransformers/netTransformer

@Override
public void loadGraphml() throws Exception {
  final G graph = factory.create();
  MyGraphMLReader gmlr = loadGraphmlInGraph(urlPath, graph);
  Collection<String> verteces = graph.getVertices();
  for (String vertex :verteces){
    if(!entireGraph.containsVertex(vertex)){
      entireGraph.addVertex(vertex);
    }
  }
  Collection<String> edges = graph.getEdges();
  for (String edge : edges){
    Pair<String> endpoints = graph.getEndpoints(edge);
    if (!entireGraph.containsEdge(edge)){
      entireGraph.addEdge(edge,endpoints);
    }
  }
  graphMetadatas = gmlr.getGraphMetadata();
  edgeMetadatas = gmlr.getEdgeMetadata();
  vertexMetadatas = gmlr.getVertexMetadata();
  notifyListeners(gmlr.getVertexMetadata(), gmlr.getEdgeMetadata(), graph);
}

相关文章