Package-level declarations

Types

Link copied to clipboard
typealias AdjacencyList = MutableList<Edges>

Used to represent a weighted graph

Link copied to clipboard
typealias Components = List<List<Any>>

List of list of nodes

Link copied to clipboard
typealias Edge = Pair<Double, Int>

Edge has a weight w to a destination node v

Link copied to clipboard
typealias Edges = MutableList<Edge>

List of edges

Link copied to clipboard
typealias IntComponents = List<List<Int>>

List of list of integer nodes

Link copied to clipboard
data class Tile(val x: Int, val y: Int, var data: Any? = null)

Represents a node in the Grid graph with x and y coordinates and optional data, which can be considered the node value

Link copied to clipboard
typealias UnweightedAdjacencyList = MutableList<MutableList<Int>>

Used to represent an unweighted graph

Functions

Link copied to clipboard
fun AdjacencyList.deepCopy(): MutableList<MutableList<Edge>>

Returns a new, independent, identical AdjacencyList

Link copied to clipboard
fun AdjacencyList.toUnweightedAdjacencyList(): MutableList<MutableList<Int>>

Replaces the edges with just the destination nodes

Link copied to clipboard
fun UnweightedAdjacencyList.toWeightedAdjacencyList(): MutableList<MutableList<Pair<Double, Int>>>

Replaces the destination nodes with edges of weight 1.0