commonMain.io.github.alexandrepiveteau.graphs.UndirectedNetwork.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-graphs Show documentation
Show all versions of kotlin-graphs Show documentation
Model directed, undirected, weighted and unweighted graphs and perform computations on them in Kotlin multiplatform.
package io.github.alexandrepiveteau.graphs
/** An [UndirectedNetwork] is a [Network] and an [UndirectedGraph]. */
public interface UndirectedNetwork : Network, UndirectedGraph {
/**
* Returns the weight of the [edge].
*
* @throws NoSuchVertexException if [edge] is not a valid edge for this [UndirectedNetwork].
* @throws NoSuchEdgeException if there is no edge between the two vertices.
*/
public fun weight(edge: Edge): Int = weight(edge.component1(), edge.component2())
/**
* An object which serves as the companion of the [UndirectedNetwork], and which provides a number
* of methods to create [UndirectedNetwork]s.
*/
public companion object
}