本文整理了Java中edu.uci.ics.jung.graph.Graph.inDegree()
方法的一些代码示例,展示了Graph.inDegree()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.inDegree()
方法的具体详情如下:
包路径:edu.uci.ics.jung.graph.Graph
类名称:Graph
方法名:inDegree
[英]Returns the number of incoming edges incident to vertex
. Equivalent to getInEdges(vertex).size()
.
[中]返回与vertex
相关的传入边数。相当于getInEdges(vertex).size()
。
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Graph#inDegree(java.lang.Object)
*/
@Override
public int inDegree(V vertex) {
return delegate.inDegree(vertex);
}
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Graph#inDegree(java.lang.Object)
*/
@Override
public int inDegree(V vertex) {
return delegate.inDegree(vertex);
}
代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer
/**
* Returns the count of incoming edges to the vertex.
* @param vertex The vertex.
* @return The incoming degree.
*/
public int inDegree(Object vertex)
{
return delegate.inDegree(vertex);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Graph#inDegree(java.lang.Object)
*/
public int inDegree(V vertex) {
return delegate.inDegree(vertex);
}
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Graph#inDegree(java.lang.Object)
*/
@Override
public synchronized int inDegree(V vertex) {
return delegate.inDegree(vertex);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Graph#inDegree(java.lang.Object)
*/
public int inDegree(V vertex) {
return delegate.inDegree(vertex);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Graph#inDegree(java.lang.Object)
*/
public synchronized int inDegree(V vertex) {
return delegate.inDegree(vertex);
}
代码示例来源:origin: net.sf.jung/jung-visualization
public int inDegree(V vertex) {
return graph.inDegree(vertex);
}
public boolean isDest(V vertex, E edge) {
代码示例来源:origin: net.sf.jung/jung-samples
public Float apply(V v) {
if (stretch) {
return (float)(graph.inDegree(v) + 1) /
(graph.outDegree(v) + 1);
} else {
return 1.0f;
}
}});
}
代码示例来源:origin: uk.gov.dstl.baleen/baleen-orderers
/**
* Remove an outer layer of the graph (i.e. any nodes with an inDegree of 0)
*
* <p>Returns the set of removed vertices
*/
public static <V, E> Set<V> removeLayer(Graph<V, E> graph) {
Set<V> toRemove = new HashSet<>();
for (V v : graph.getVertices()) {
if (graph.inDegree(v) == 0) {
toRemove.add(v);
}
}
for (V v : toRemove) graph.removeVertex(v);
return toRemove;
}
代码示例来源:origin: dstl/baleen
/**
* Remove an outer layer of the graph (i.e. any nodes with an inDegree of 0)
*
* <p>Returns the set of removed vertices
*/
public static <V, E> Set<V> removeLayer(Graph<V, E> graph) {
Set<V> toRemove = new HashSet<>();
for (V v : graph.getVertices()) {
if (graph.inDegree(v) == 0) {
toRemove.add(v);
}
}
for (V v : toRemove) graph.removeVertex(v);
return toRemove;
}
代码示例来源:origin: iTransformers/netTransformer
public <G> void handleRightClick(JFrame parent, String v,
Map<String, String> graphMLParams,
Map<String, String> rightClickParams,
File projectPath,
File versionDir) throws Exception {
Logger logger = Logger.getLogger(NodeStatisticsRightClickHandler.class);
JFrame frame = new JFrame(" report for " + v + " ");
frame.setSize(300, 200);
frame.getContentPane().setLayout(new BorderLayout());
JTextPane text = new JTextPane();
text.setEditable(true);
text.setContentType("text/html");
StringBuilder sb = new StringBuilder();
TopologyManagerFrame viewer = (TopologyManagerFrame) parent;
final GraphViewerPanel viewerPanel = (GraphViewerPanel) viewer.getTabbedPane().getSelectedComponent();
final MyVisualizationViewer vv = (MyVisualizationViewer) viewerPanel.getVisualizationViewer();
Graph currentGraph = viewerPanel.getCurrentGraph();
int inDegree = currentGraph.inDegree(v);
int outDegree = currentGraph.outDegree(v);
sb.append("Number of incoming edges: ").append(inDegree);
sb.append("\n");
sb.append("Number of outgoing edges: ").append(outDegree);
text.setText(sb.toString());
JScrollPane scrollPane = new JScrollPane(text);
frame.getContentPane().add("Center", scrollPane);
frame.setVisible(true);
}
代码示例来源:origin: net.sf.jung/jung-algorithms
public Double apply(VEPair<V,E> ve_pair)
{
V v = ve_pair.getV();
E e = ve_pair.getE();
if (graph.getEdgeType(e) != EdgeType.DIRECTED)
throw new IllegalArgumentException("This Function only" +
" operates on directed edges");
return 1.0 / (graph.isSource(v, e) ?
graph.outDegree(v) :
graph.inDegree(v));
}
}
代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2
double degree = mGraph.inDegree(attach_point);
代码示例来源:origin: geogebra/geogebra
double degree = mGraph.inDegree(attach_point);
代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2
/**
* @see org.apache.commons.collections15.Transformer#transform(Object)
* @throws IllegalArgumentException
*/
public Double transform(VEPair<V,E> ve_pair)
{
V v = ve_pair.getV();
E e = ve_pair.getE();
if (graph.getEdgeType(e) != EdgeType.DIRECTED)
throw new IllegalArgumentException("This transformer only" +
" operates on directed edges");
return 1.0 / (graph.isSource(v, e) ?
graph.outDegree(v) :
graph.inDegree(v));
}
}
代码示例来源:origin: geogebra/geogebra
/**
* @see org.apache.commons.collections15.Transformer#transform(Object)
* @throws IllegalArgumentException
*/
@Override
public Double transform(VEPair<V, E> ve_pair) {
V v = ve_pair.getV();
E e = ve_pair.getE();
if (graph.getEdgeType(e) != EdgeType.DIRECTED) {
throw new IllegalArgumentException(
"This transformer only" + " operates on directed edges");
}
return 1.0 / (graph.isSource(v, e) ? graph.outDegree(v)
: graph.inDegree(v));
}
}
代码示例来源:origin: net.sf.jung/jung-algorithms
denominator = (2 * mGraph.getEdgeCount()) + mGraph.getVertexCount() - 1;
} else {
degree = mGraph.inDegree(v);
denominator = mGraph.getEdgeCount() + mGraph.getVertexCount() - 1;
代码示例来源:origin: org.opendaylight.controller/routing.dijkstra_implementation
if (topo.containsVertex(src.getNode()) && (topo.inDegree(src.getNode()) == 0)
&& (topo.outDegree(src.getNode()) == 0)) {
log.debug("Removing vertex {}", src);
if (topo.containsVertex(dst.getNode()) && (topo.inDegree(dst.getNode()) == 0)
&& (topo.outDegree(dst.getNode()) == 0)) {
log.debug("Removing vertex {}", dst);
内容来源于网络,如有侵权,请联系作者删除!