本文整理了Java中edu.uci.ics.jung.graph.Graph.isSuccessor()
方法的一些代码示例,展示了Graph.isSuccessor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.isSuccessor()
方法的具体详情如下:
包路径:edu.uci.ics.jung.graph.Graph
类名称:Graph
方法名:isSuccessor
[英]Returns true
if v1
is a successor of v2
in this graph. Equivalent to v1.getSuccessors().contains(v2)
.
[中]
代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer
/**
* Returns <code>true</code> if there is an edge from second vertex to the first vertex.
* @param v1 The first vertex.
* @param v2 The second vertex.
* @return <code>true</code> if the second vertex is successor of the fist vertex.
*/
public boolean isSuccessor(Object v1, Object v2)
{
return delegate.isSuccessor(v1, v2);
}
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Graph#isSuccessor(java.lang.Object,
* java.lang.Object)
*/
@Override
public synchronized boolean isSuccessor(V v1, V v2) {
return delegate.isSuccessor(v1, v2);
}
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Graph#isSuccessor(java.lang.Object,
* java.lang.Object)
*/
@Override
public boolean isSuccessor(V v1, V v2) {
return delegate.isSuccessor(v1, v2);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Graph#isSuccessor(java.lang.Object, java.lang.Object)
*/
public synchronized boolean isSuccessor(V v1, V v2) {
return delegate.isSuccessor(v1, v2);
}
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Graph#isSuccessor(java.lang.Object,
* java.lang.Object)
*/
@Override
public boolean isSuccessor(V v1, V v2) {
return delegate.isSuccessor(v1, v2);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Graph#isSuccessor(java.lang.Object, java.lang.Object)
*/
public boolean isSuccessor(V v1, V v2) {
return delegate.isSuccessor(v1, v2);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Graph#isSuccessor(java.lang.Object, java.lang.Object)
*/
public boolean isSuccessor(V v1, V v2) {
return delegate.isSuccessor(v1, v2);
}
代码示例来源:origin: net.sf.jung/jung-visualization
public boolean isSuccessor(V v1, V v2) {
return graph.isSuccessor(v1, v2);
}
public int outDegree(V vertex) {
代码示例来源:origin: net.sf.jung/jung-algorithms
b &= ( g.isSuccessor(v1, v2) == g.isSuccessor(v2, v1));
b &= ( g.isSuccessor(v1, v1) == g.isSuccessor(v2, v2));
代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2
b &= ( g.isSuccessor(v1, v2) == g.isSuccessor(v2, v1));
b &= ( g.isSuccessor(v1, v1) == g.isSuccessor(v2, v2));
代码示例来源:origin: geogebra/geogebra
b &= (g.isSuccessor(v1, v2) == g.isSuccessor(v2, v1));
b &= (g.isSuccessor(v1, v1) == g.isSuccessor(v2, v2));
代码示例来源:origin: net.sf.jung/jung-algorithms
protected Graph<V,E> initializeGraph() {
Graph<V,E> graph = null;
graph = graphFactory.get();
for(int i=0; i<mNumVertices; i++) {
graph.addVertex(vertexFactory.get());
}
List<V> vertices = new ArrayList<V>(graph.getVertices());
while (graph.getEdgeCount() < mNumEdges) {
V u = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
V v = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
if (!graph.isSuccessor(v,u)) {
graph.addEdge(edgeFactory.get(), u, v);
}
}
double maxDegree = 0;
for (V v : graph.getVertices()) {
maxDegree = Math.max(graph.degree(v),maxDegree);
}
mMaxDegree = maxDegree; //(maxDegree+1)*(maxDegree)/2;
return graph;
}
代码示例来源:origin: net.sf.jung/jung-algorithms
/**
* Generates a graph whose degree distribution approximates a power-law.
* @return the generated graph
*/
public Graph<V,E> get() {
Graph<V,E> graph = initializeGraph();
List<V> vertices = new ArrayList<V>(graph.getVertices());
for (int rIdx = 0; rIdx < mNumIterations; rIdx++) {
V v = null;
int degree = 0;
do {
v = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
degree = graph.degree(v);
} while (degree == 0);
List<E> edges = new ArrayList<E>(graph.getIncidentEdges(v));
E randomExistingEdge = edges.get((int) (mRandom.nextDouble()*degree));
// FIXME: look at email thread on a more efficient RNG for arbitrary distributions
V x = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
V y = null;
do {
y = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
} while (mRandom.nextDouble() > ((graph.degree(y)+1)/mMaxDegree));
if (!graph.isSuccessor(y,x) && x != y) {
graph.removeEdge(randomExistingEdge);
graph.addEdge(edgeFactory.get(), x, y);
}
}
return graph;
}
代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2
/**
* Generates a graph whose degree distribution approximates a power-law.
* @return the generated graph
*/
public Graph<V,E> create() {
Graph<V,E> graph = initializeGraph();
List<V> vertices = new ArrayList<V>(graph.getVertices());
for (int rIdx = 0; rIdx < mNumIterations; rIdx++) {
V v = null;
int degree = 0;
do {
v = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
degree = graph.degree(v);
} while (degree == 0);
List<E> edges = new ArrayList<E>(graph.getIncidentEdges(v));
E randomExistingEdge = edges.get((int) (mRandom.nextDouble()*degree));
// FIXME: look at email thread on a more efficient RNG for arbitrary distributions
V x = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
V y = null;
do {
y = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
} while (mRandom.nextDouble() > ((graph.degree(y)+1)/mMaxDegree));
if (!graph.isSuccessor(y,x) && x != y) {
graph.removeEdge(randomExistingEdge);
graph.addEdge(edgeFactory.create(), x, y);
}
}
return graph;
}
代码示例来源:origin: geogebra/geogebra
.nextDouble() > ((graph.degree(y) + 1) / mMaxDegree));
if (!graph.isSuccessor(y, x) && x != y) {
graph.removeEdge(randomExistingEdge);
graph.addEdge(edgeFactory.create(), x, y);
代码示例来源:origin: geogebra/geogebra
protected Graph<V, E> initializeGraph() {
Graph<V, E> graph = null;
graph = graphFactory.create();
for (int i = 0; i < mNumVertices; i++) {
graph.addVertex(vertexFactory.create());
}
List<V> vertices = new ArrayList<V>(graph.getVertices());
while (graph.getEdgeCount() < mNumEdges) {
V u = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
V v = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
if (!graph.isSuccessor(v, u)) {
graph.addEdge(edgeFactory.create(), u, v);
}
}
double maxDegree = 0;
for (V v : graph.getVertices()) {
maxDegree = Math.max(graph.degree(v), maxDegree);
}
mMaxDegree = maxDegree; // (maxDegree+1)*(maxDegree)/2;
return graph;
}
代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2
protected Graph<V,E> initializeGraph() {
Graph<V,E> graph = null;
graph = graphFactory.create();
for(int i=0; i<mNumVertices; i++) {
graph.addVertex(vertexFactory.create());
}
List<V> vertices = new ArrayList<V>(graph.getVertices());
while (graph.getEdgeCount() < mNumEdges) {
V u = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
V v = vertices.get((int) (mRandom.nextDouble() * mNumVertices));
if (!graph.isSuccessor(v,u)) {
graph.addEdge(edgeFactory.create(), u, v);
}
}
double maxDegree = 0;
for (V v : graph.getVertices()) {
maxDegree = Math.max(graph.degree(v),maxDegree);
}
mMaxDegree = maxDegree; //(maxDegree+1)*(maxDegree)/2;
return graph;
}
内容来源于网络,如有侵权,请联系作者删除!