Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions algebraic-graphs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ library
Algebra.Graph.Labelled.Example.Automaton,
Algebra.Graph.Labelled.Example.Network,
Algebra.Graph.NonEmpty,
Algebra.Graph.NonEmpty.AdjacencyIntMap,
Algebra.Graph.NonEmpty.AdjacencyMap,
Algebra.Graph.Relation,
Algebra.Graph.Relation.Preorder,
Expand Down Expand Up @@ -148,6 +149,7 @@ test-suite test-alga
Algebra.Graph.Test.Label,
Algebra.Graph.Test.Labelled.AdjacencyMap,
Algebra.Graph.Test.Labelled.Graph,
Algebra.Graph.Test.NonEmpty.AdjacencyIntMap,
Algebra.Graph.Test.NonEmpty.AdjacencyMap,
Algebra.Graph.Test.NonEmpty.Graph,
Algebra.Graph.Test.Relation,
Expand Down
4 changes: 2 additions & 2 deletions src/Algebra/Graph/AdjacencyIntMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ hasEdge u v (AM m) = case IntMap.lookup u m of
Just vs -> IntSet.member v vs

-- | The number of vertices in a graph.
-- Complexity: /O(1)/ time.
-- Complexity: /O(n)/ time.
--
-- @
-- vertexCount 'empty' == 0
Expand All @@ -416,7 +416,7 @@ vertexCount :: AdjacencyIntMap -> Int
vertexCount = IntMap.size . adjacencyIntMap

-- | The number of edges in a graph.
-- Complexity: /O(n)/ time.
-- Complexity: /O(n+m)/ time.
--
-- @
-- edgeCount 'empty' == 0
Expand Down
8 changes: 5 additions & 3 deletions src/Algebra/Graph/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ module Algebra.Graph.Internal (

import Data.Coerce
import Data.Foldable
import Data.Maybe
import Data.Semigroup
import Data.IntSet (IntSet)
import Data.Set (Set)

import qualified Data.IntSet as IntSet
import qualified Data.Set as Set
import qualified GHC.Exts as Exts
import qualified Data.List.NonEmpty as NonEmpty
import qualified Data.IntSet as IntSet
import qualified Data.Set as Set
import qualified GHC.Exts as Exts

-- | An abstract list data type with /O(1)/ time concatenation (the current
-- implementation uses difference lists). Here @a@ is the type of list elements.
Expand Down
Loading