GraphMetrics

scalation.database.graph_pm.GraphMetrics
See theGraphMetrics companion object
class GraphMetrics(val g: Graph, isUndirected: Boolean)

The GraphMetrics class provides methods for determining graph metrics that can be efficiently computed using Breadth-First Search (BFS). This works for undirected graphs. If a directed graph is passed in, it will be converted to a corresponding undirected graph.

Value parameters

g

the graph whose metrics are sought

isUndirected

indicates whether the graph is undirected

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def central: Array[Int]

Return the central vertices, those with eccentricities equal to the radius.

Return the central vertices, those with eccentricities equal to the radius.

Attributes

def diam: Int

Compute the diameter of graph g (i.e., maximum eccentricity). This also equals the "longest shortest path" between any pair of vertices in graph g.

Compute the diameter of graph g (i.e., maximum eccentricity). This also equals the "longest shortest path" between any pair of vertices in graph g.

Attributes

def ecc(i: Int): Int

Compute the eccentricity of vertex i (the length of the longest path from vertex i to any other vertex).

Compute the eccentricity of vertex i (the length of the longest path from vertex i to any other vertex).

Value parameters

i

the vertex whose eccentricity is sought

Attributes

def rad: Int

Compute the radius of graph g (i.e., minimum eccentricity).

Compute the radius of graph g (i.e., minimum eccentricity).

Attributes

Concrete fields

val g: Graph