greedyIndSet :: ArrayGraph -> [Int]
greedyIndSet (ArrayGraph graph sg) = gis sg
  where
    gis sg@(Subgraph _ ds) =
      case minDegs ds of
        []    -> []
        (x:_) -> x : gis (updateSubgraph graph sg x)
greedyIndSet :: ArrayGraph -> [Int]
greedyIndSet (ArrayGraph graph sg) = gis sg
  where
    gis sg@(Subgraph _ ds) =
      case minDegs ds of
        []    -> []
        (x:_) -> x : gis (updateSubgraph graph sg x)
greedyIndSet (ArrayGraph graph sg) = gis sg
  where
    gis sg@(Subgraph _ ds) =
      case minDegs ds of
        []    -> []
        (x:_) -> x : gis (updateSubgraph graph sg x)