Skip to content

Instantly share code, notes, and snippets.

View emmanueldenloye's full-sized avatar

Emmanuel Denloye-Ito emmanueldenloye

  • New York, New York
View GitHub Profile
@emmanueldenloye
emmanueldenloye / shortestPathsMatrix.hs
Last active March 19, 2016 02:46
(Using FGL) Determine the shortestPath matrix if and only if the graph is fully connected.
import Control.Monad.ST
import Data.Graph.Inductive
import qualified Data.Graph.Inductive.PatriciaTree as GP
import Data.Maybe
import Data.STRef
import Numeric.LinearAlgebra
import Numeric.LinearAlgebra.Devel
-- The result is wrapped in a Maybe just in case, the graph is not fully connected.
-- There is a function to test for connectivity in FGL, but in my use case,