Graph

interface Graph<V : Any, E : Any> : Cloneable

Represents a graph.

Author

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

Functions

clone
Link copied to clipboard
abstract override fun clone(): Graph<V, E>
Clones the graph.
cloneAsMutable
Link copied to clipboard
abstract fun cloneAsMutable(): MutableGraph<V, E>
Clones the graph as MutableGraph.
contains
Link copied to clipboard
open operator fun contains(value: V): Boolean
Returns true if graph contains value; false otherwise.
open operator fun contains(edge: Edge<V, E>): Boolean
Returns true if graph contains edge; false otherwise.
get
Link copied to clipboard
abstract operator fun get(value: V): Vertex<V, E>
Returns vertex by value.
getEdges
Link copied to clipboard
abstract fun getEdges(startFrom: V, endWith: V, limit: Int = -1): Collection<Edge<V, E>>
Returns list of the edges which starts from startFrom and ends with endWith.
isConnected
Link copied to clipboard
open fun isConnected(startFrom: V, endWith: V): Boolean
Returns true if startFrom and endWith vertexes are connected; false otherwise.

Properties

dynamicEdgesCount
Link copied to clipboard
abstract val dynamicEdgesCount: Int
A number of edges with mutable weight.
edgesCount
Link copied to clipboard
abstract val edgesCount: Int
A total number of edges in the graph.
isEmpty
Link copied to clipboard
open val isEmpty: Boolean
Indicates that the graph is empty.
isOriented
Link copied to clipboard
open val isOriented: Boolean
Indicates that the graph has only oriented edges.
orientedEdgesCount
Link copied to clipboard
abstract val orientedEdgesCount: Int
A number of oriented edges.
values
Link copied to clipboard
abstract val values: Collection<V>
A list of vertexes values.
vertexes
Link copied to clipboard
abstract val vertexes: Collection<Vertex<V, E>>
A list of vertexes.

Inheritors

MutableGraph
Link copied to clipboard