File: bcc.hs

package info (click to toggle)
haskell-fgl 5.4.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 256 kB
  • ctags: 2
  • sloc: haskell: 2,050; makefile: 4
file content (16 lines) | stat: -rw-r--r-- 362 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Main where

import Data.Graph.Inductive
import List

mkUndirectedUGraph v e = mkUGraph v [ (x, y) | (x0, y0) <- e, (x, y) <- [(x0, y0), (y0, x0)] ]

graph :: Gr () ()
graph = mkUndirectedUGraph [1..5] [(1, 2), (2, 3), (2, 4), (3, 5)]

bccEdges g = sort (concat $ map edges $ bcc g) == sort (edges g)

prop_bcc = bccEdges graph

main = do
  print prop_bcc