Companion

object Companion

Functions

Link copied to clipboard
fun <T, W> build(builder: MutableGraph<T, W>.() -> Unit): Graph<T, W>

Builds a new, immutable Graph by applying builder to a fresh MutableGraph, then converting the result back to an immutable Graph. Equivalent to MutableGraph.build(builder).toImmutable().

Link copied to clipboard
fun <T, W> empty(): Graph<T, W>

Returns a new, empty Graph (no nodes, no edges).

Link copied to clipboard
fun <T, W> of(edges: Iterable<Edge<T, W>>): Graph<T, W>
fun <T, W> of(edges: Sequence<Edge<T, W>>): Graph<T, W>

Creates a new Graph containing exactly the given edges, and their endpoint nodes.

fun <T, W> of(edge: Edge<T, W>, vararg edges: Edge<T, W>): Graph<T, W>

Creates a new Graph containing exactly edge (and any edges), and their endpoint nodes.