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

commonMain.io.github.alexandrepiveteau.graphs.DirectedNetwork.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

/** A [DirectedNetwork] is a [Network] and a [DirectedGraph]. */
public interface DirectedNetwork : Network, DirectedGraph {

  /**
   * Returns the weight of the [Arc].
   *
   * @throws NoSuchVertexException if [arc] is not a valid arc for this [UndirectedNetwork].
   * @throws NoSuchEdgeException if there is no arc between the two vertices.
   */
  public fun weight(arc: Arc): Int = weight(arc.from, arc.to)

  /**
   * An object which serves as the companion of the [DirectedNetwork], and which provides a number
   * of methods to create [DirectedNetwork]s.
   */
  public companion object
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy