Skip to content

Instantly share code, notes, and snippets.

View sdx23's full-sized avatar

sdx23 sdx23

View GitHub Profile
@sdx23
sdx23 / bfs.hs
Created November 30, 2015 19:42
import Data.List (elemIndices,(\\))
----------------------------------------------------------------------
-- main: some io and organisational stuff
main :: IO ()
main = do
-- read adjacency matrix file to matrix :: [[Int]]
matrixfile <- readFile "RandomGraph.txt"
let matrix = map (map (read :: String -> Int) . words) $ lines matrixfile