goyalarchit/graph-extra/1.0.0

NOTE: the latest version is 1.0.1

Rerouted (regenerated, verified). Same repository and tag, but GitHub now builds the zip with different bytes, so it no longer matches the SHA-1 package.elm-lang.org recorded. The Lamdera package server serves a copy recovered from https://github.com/goyalarchit/graph-extra.

What we checked: Rebuilt with git archive from commit b34f560db75d of https://github.com/goyalarchit/graph-extra (zip prefix goyalarchit-graph-extra-b34f560/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 6563e8b87916dacf0ec4c5bc9ecfe8a209cabb8b.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/goyalarchit/graph-extra/zipball/1.0.0/

Graph.Extra

This module implements additional convenience functions to work with the elm-community/graph

Utility

alongAnyEdges : NodeContext n e -> List NodeId

A good default for selecting neighbors that go along outgoing edges or follow along incoming edges:

Algorithms

NodeId
-> (Edge e -> number)
-> Graph n e
-> Result String (Dict NodeId ( number, List NodeId ))

An implementation of bellman ford algorithm, for finding shortest path between single source and all vertices. Returns them as a dictionary or an error in Result type.

Note: You may know error occurs in case there is a negative weight cycle.

kruskal : (Edge e -> number) -> Graph n e -> Graph n e

This algorithms returns the minimum spanning tree for the given graph using Kruskal's algorithm.

Note :

  1. Returns Minimum Spanning Arborescence in case of directed graph

  2. Assumes directed graphs, so if you want MST on undirected graph, pass (Graph.symmetricClosure graph)