BaseNavigationGraph

open class BaseNavigationGraph<V : Vector<V>, A : Transformation<V>, N : ConvexShape<V, A>, E>(vertexSupplier: Supplier<N>?, edgeSupplier: Supplier<E>?, graphType: GraphType) : AbstractBaseGraph<N, E> , NavigationGraph<V, A, N, E>

An implementation of NavigationGraph, deriving from AbstractBaseGraph. The user can specify the GraphType so as to obtain a custom graph (e.g. weighted or not, directed or undirected, etc). AbstractBaseGraph guarantees deterministic ordering for the collection it maintains, as stated in its api documentation. Note that vertices and edges are used as keys inside AbstractBaseGraph, so when choosing their types, you must follow these rules:

  • You must follow the contract defined in java.lang.Object for both equals and hashCode.

  • In particular, if you override either equals or hashCode, you must override them both.

  • Your implementation for hashCode must produce a value which does not change over the lifetime of the object. Further information available here.

Inheritors

Constructors

Link copied to clipboard
constructor(edgeClass: Class<out E>, directed: Boolean)
constructor(vertexSupplier: Supplier<N>?, edgeSupplier: Supplier<E>?, graphType: GraphType)

Properties

Link copied to clipboard
Link copied to clipboard
val type: GraphType
Link copied to clipboard

Functions

Link copied to clipboard
open override fun addEdge(p0: N, p1: N): E
open override fun addEdge(p0: N, p1: N, p2: E): Boolean
Link copied to clipboard
open override fun addVertex(): N
open override fun addVertex(p0: N): Boolean
Link copied to clipboard
open override fun clone(): Any
Link copied to clipboard
open override fun containsEdge(p0: E): Boolean
open override fun containsEdge(p0: N, p1: N): Boolean
Link copied to clipboard
open override fun containsVertex(p0: N): Boolean
Link copied to clipboard
open override fun degreeOf(p0: N): Int
Link copied to clipboard
open override fun edgeSet(): MutableSet<E>
Link copied to clipboard
open override fun edgesOf(p0: N): MutableSet<E>
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun getAllEdges(p0: N, p1: N): MutableSet<E>
Link copied to clipboard
open override fun getEdge(p0: N, p1: N): E
Link copied to clipboard
open override fun getEdgeSource(p0: E): N
Link copied to clipboard
open override fun getEdgeTarget(p0: E): N
Link copied to clipboard
open override fun getEdgeWeight(p0: E): Double
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun incomingEdgesOf(p0: N): MutableSet<E>
Link copied to clipboard
open override fun inDegreeOf(p0: N): Int
Link copied to clipboard
open override fun iterables(): GraphIterables<N, E>
Link copied to clipboard
open fun nodeContaining(position: V): N?
Link copied to clipboard
open override fun outDegreeOf(p0: N): Int
Link copied to clipboard
open override fun outgoingEdgesOf(p0: N): MutableSet<E>
Link copied to clipboard
fun <V> Graph<V, *>.pathExists(source: V, sink: V): Boolean

Checks whether a path exists between source and sink. DijkstraShortestPath is used instead of org.jgrapht.alg.connectivity.ConnectivityInspector.pathExists, because, in case of directed graph, the latter checks whether the given vertices lay in the same weakly connected component, which is not the desired behavior. As unweighted graphs have a default edge weight of 1.0, shortest path algorithms can always be applied meaningfully.

Link copied to clipboard
open override fun removeAllEdges(p0: MutableCollection<out E>): Boolean
open override fun removeAllEdges(p0: N, p1: N): MutableSet<E>
Link copied to clipboard
open override fun removeAllVertices(p0: MutableCollection<out N>): Boolean
Link copied to clipboard
open override fun removeEdge(p0: E): Boolean
open override fun removeEdge(p0: N, p1: N): E
Link copied to clipboard
open override fun removeVertex(p0: N): Boolean
Link copied to clipboard
open fun setEdgeWeight(p0: N, p1: N, p2: Double)
open override fun setEdgeWeight(p0: E, p1: Double)
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun vertexSet(): MutableSet<N>