Analyst

interface Analyst<V : Any, E : Any>

Represents an interface of analytic operations with a graph.

Author

Alexander Kornilov (akornilov.82@gmail.com).

Functions

getPath
Link copied to clipboard
abstract fun getPath(startFrom: V, endWith: V): Path<V, E>?
Returns optimal path between startFrom and endWith vertexes if it exists; null otherwise.
getPaths
Link copied to clipboard
abstract fun getPaths(startFrom: V, endWith: V, limit: Int = -1): List<Path<V, E>>
Returns list of all possible paths between startFrom and endWith vertexes.
getShortestEdge
Link copied to clipboard
open fun getShortestEdge(startFrom: V, endWith: V, onlyWeighted: Boolean = true, defaultWeight: Double = Edge.DefaultWeight): Edge<V, E>?
Returns shortest edge between startFrom and endWith vertexes if present; null otherwise.
hasPath
Link copied to clipboard
abstract fun hasPath(startFrom: V, endWith: V): Boolean
Returns true when path from startFrom to endsWith can be found; false otherwise.
sortTopological
Link copied to clipboard
abstract fun sortTopological(): List<Set<V>>
Returns vertexes list of the graph in topological order if possible; empty list otherwise.

Properties

graph
Link copied to clipboard
abstract val graph: Graph<V, E>
A source graph.