org.jgrapht.Graph.inDegreeOf()方法的使用及代码示例

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

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

Graph.inDegreeOf介绍

[英]Returns the "in degree" of the specified vertex.

The "in degree" of a vertex in a directed graph is the number of inward directed edges from that vertex. See http://mathworld.wolfram.com/Indegree.html.

In the case of undirected graphs this method returns the number of edges touching the vertex. Edges with same source and target vertices (self-loops) are counted twice.
[中]返回指定顶点的“度数”。
有向图中顶点的“度”是该顶点向内有向边的数目。见http://mathworld.wolfram.com/Indegree.html
对于无向图,此方法返回接触顶点的边数。具有相同源顶点和目标顶点(自循环)的边将计数两次。

代码示例

代码示例来源:origin: cwensel/cascading

public int inDegreeOf( FlowElement vertex )
 {
 return graph.inDegreeOf( vertex );
 }

代码示例来源:origin: org.jgrapht/jgrapht-core

/**
 * {@inheritDoc}
 */
@Override
public int inDegreeOf(V vertex)
{
  return delegate.inDegreeOf(vertex);
}

代码示例来源:origin: org.jgrapht/jgrapht-core

/**
 * {@inheritDoc}
 */
@Override
public int inDegreeOf(V vertex)
{
  if (type.isMixed()) {
    int d = 0;
    if (g1.containsVertex(vertex)) {
      d += g1.inDegreeOf(vertex);
    }
    if (g2.containsVertex(vertex)) {
      d += g2.inDegreeOf(vertex);
    }
    return d;
  } else if (type.isUndirected()) {
    return degreeOf(vertex);
  } else {
    return incomingEdgesOf(vertex).size();
  }
}

代码示例来源:origin: org.jgrapht/jgrapht-core

V startVertex = null;
for (V v : scc) {
  int inDegree = graph.inDegreeOf(v);
  if (inDegree > maxInDegree) {
    maxInDegree = inDegree;

代码示例来源:origin: org.jgrapht/jgrapht-core

Set<V> postImbalancedVertices = new HashSet<>();
for (V v : graph.vertexSet()) {
  int imbalance = graph.outDegreeOf(v) - graph.inDegreeOf(v);

代码示例来源:origin: cwensel/cascading

if( contracted.inDegreeOf( v ) == 0 )
 excludeEdges.addAll( full.incomingEdgesOf( v ) );

代码示例来源:origin: org.jgrapht/jgrapht-core

if (graph.inDegreeOf(v) != graph.outDegreeOf(v)) {
  return false;
  if (graph.inDegreeOf(v) > 0 || graph.outDegreeOf(v) > 0) {
    if (foundComponentWithEdges) {
      return false;

相关文章