Skip to content

Dijkstra's shortest path algorithm implemented at type level with Haskell

License

Notifications You must be signed in to change notification settings

yigitozkavci/typelevel-dijkstra-sp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

typelevel-dijkstra-sp

Dijkstra's shortest path algorithm implemented at type level with Haskell

How To Run

$ ghci Dijkstra.hs
> :kind! Solution
= '[0, 6, 2, 5]

How to play with the graph

The type synonym Adj contains the graph data in adjacency matrix format. Here is the convention we follow:

  • Every node has 0 distance to itself
  • Every node has infinite (Inf) distance to any of its non-neighbour

There is an example test case, which is named test_result_1. If you change the constraint array on there, the module will not compile.

About

Dijkstra's shortest path algorithm implemented at type level with Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published