public static class Directed.Sparse extends Directed implements Graph.Sparse
Directed.Dense and Undirected.Sparse.| Modifier and Type | Class and Description |
|---|---|
class |
Directed.Sparse.Induced
An induced subgraph of a Sparse Directed Graph is
Sparse and Directed.
|
class |
Directed.Sparse.Renumbered
A Sparse Directed Graph renumbered accpording to
vs is Sparse and Directed. |
Directed.AsUndirected, Directed.C, Directed.Dense, Directed.Edge, Directed.Sparse, Directed.VertexGraph.Canonical, Graph.Contraction, Graph.Derived, Graph.SubGraph, Graph.SubGraphs, Graph.ToDirected, Graph.ToUndirectedValue.Atomic, Value.Bool, Value.Char, Value.Chars, Value.Cts, Value.Defer, Value.Discrete, Value.Enum, Value.Inc_Or, Value.Int, Value.Lambda, Value.List, Value.Maybe, Value.Option, Value.Real, Value.Scannable, Value.Structured, Value.Triv, Value.Tuple| Modifier and Type | Field and Description |
|---|---|
int[][] |
es
The Edges of 'this' Sparse, as an int[E][2] array.
|
int[][] |
pred
Given an Edge 〈v0, v1〉, v1 is in (ascending) succ[v0],
and v0 is in (ascending) pred[v1].
|
int[][] |
succ
Given an Edge 〈v0, v1〉, v1 is in (ascending) succ[v0],
and v0 is in (ascending) pred[v1].
|
unlabelled, unlabelled_O| Constructor and Description |
|---|
Sparse(int[][] es)
Assume that the max Vertex mentioned in es is the last Vertex.
|
Sparse(Type t,
int V,
int[][] es)
Directed Edges
|
| Modifier and Type | Method and Description |
|---|---|
Series.Int |
directPredecessors(int v)
Only applicable to
Directed Graphs. |
Series.Int |
directSuccessors(int v)
Only applicable to
Directed Graphs. |
int |
eSize()
The number of Edges in 'this' Graph, |E|≥0.
|
int |
inDegree(int v)
O(1)-time.
|
Directed.Sparse.Induced |
induced(int[] vs)
An induced subgraph of a Sparse Directed Graph is
Sparse and Directed.
|
boolean |
isEdge(int v0,
int v1)
Is 〈v0, v1〉 an Edge in 'this' Graph?
Also see
adjacent(v0,v1). |
Series.Int |
joinedTo(int v)
An increasing Series of those Vertices 'w'
adjacent to v, that is (v,w) is an Edge or
(w,v) is (includes v, once, if there is a loop (v,v)). |
static int |
maxV(int[][] es)
Return the largest Vertex number mentioned in
es,
which may or may not be the largest one in the Graph. |
int |
outDegree(int v)
O(1)-time.
|
Directed.Sparse.Renumbered |
renumbered(int[] vs)
A renumbered Sparse Directed Graph is Sparse and Directed.
|
java.lang.String |
toString()
|
Type |
type()
Note, type(),
Graph.adjacent(int, int),
Graph.vLabelled(), Graph.vLabel(int),
Graph.eLabelled(), and Graph.eLabel(int, int) must be consistent. |
int |
vSize()
The number of Vertices, |V|≥1,
|
asUndirected, degree, dense, dense, dense, dense, dense, dense, main, sparse, toDirectedA, adjacent, arrayA, byDegree, byDegree, canonical, canonical1, canonical1R, canonical2, canonical2R, checkProperties, contraction, edges, edgesCorrespond, eLabel, eLabelled, eLabels, eStats, flatten, hashCode, isDirected, isomorphic, isUndirected, localHash, maxEdges, nAutomorphisms, randomised, selfLoops, structurallyIdentical, subGraphs, subGraphs, toUndirected, vLabel, vLabelled, vLabels, vPair2npublic final int[][] succ
public final int[][] pred
public final int[][] es
public Sparse(int[][] es)
public Sparse(Type t, int V, int[][] es)
public Type type()
GraphGraph.adjacent(int, int),
Graph.vLabelled(), Graph.vLabel(int),
Graph.eLabelled(), and Graph.eLabel(int, int) must be consistent.public int vSize()
GrapheSize().public int eSize()
GraphvSize().public boolean isEdge(int v0,
int v1)
Graphadjacent(v0,v1).public Series.Int joinedTo(int v)
Graphadjacent to v, that is (v,w) is an Edge or
(w,v) is (includes v, once, if there is a loop (v,v)).
Note, this default is inefficient for sparse Graphs but
also see joinedTo(int) and
Undirected.Sparse.joinedTo(int).public Series.Int directPredecessors(int v)
GraphDirected Graphs.
An increasing Series of those Vertices 'p' such that
〈p,v〉 is an Edge (includes v if there is a loop
〈v,v〉). Note, this default is inefficient for sparse
Graphs but see directPredecessors(int)directPredecessors in class Graphpublic Series.Int directSuccessors(int v)
GraphDirected Graphs.
An increasing Series of those Vertices 's' such that
〈v,s〉 is an Edge (includes v if there is a loop
〈v,v〉). Note, this default is inefficient for sparse
Graphs but see directSuccessors(int).directSuccessors in class Graphpublic static int maxV(int[][] es)
es,
which may or may not be the largest one in the Graph.
Look at Sparse's constructors.public java.lang.String toString()
Valueprinting of
constants, and in calls to Value.error(java.lang.String).
The result does not necessarily fully specify a large, or
infinite(!), Value. (This default returns the Class Name of 'this'.)
Also see print(ps).public Directed.Sparse.Renumbered renumbered(int[] vs)
renumbered in class Graphpublic Directed.Sparse.Induced induced(int[] vs)