Package it.unibo.alchemist.model.implementations.geometry.euclidean2d.graph

Types

Link copied to clipboard
open class BaseNavigationGraph<V : Vector<V>, A : GeometricTransformation<V>, N : ConvexGeometricShape<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:

Link copied to clipboard
class DirectedNavigationGraph<V : Vector<V>, A : GeometricTransformation<V>, N : ConvexGeometricShape<V, A>, E>(edgeClass: Class<out E>) : BaseNavigationGraph<V, A, N, E>

A directed unweighted NavigationGraph, allowing multiple edges between the same pair of vertices and without self-loops (i.e. edges connecting a node to itself).

Link copied to clipboard
class UndirectedNavigationGraph<V : Vector<V>, A : GeometricTransformation<V>, N : ConvexGeometricShape<V, A>, E>(edgeClass: Class<out E>) : BaseNavigationGraph<V, A, N, E>

An undirected unweighted NavigationGraph, allowing multiple edges between the same pair of vertices and without self-loops (i.e. edges connecting a node to itself).

Functions

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.