All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.github.alexandrepiveteau.graphs.UndirectedNetwork.kt Maven / Gradle / Ivy

Go to download

Model directed, undirected, weighted and unweighted graphs and perform computations on them in Kotlin multiplatform.

There is a newer version: 0.6.1
Show newest version
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
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy