Comments (3)
The implementation is literally (?) from (e.g.,) Cormen, Leiserson, Rivest: Introduction to Algorithms, Section 23.5 (ninth edition), and O(vertices + edges) is optimal. So this is about the hidden constant factor?
Is there reason to believe that this is critical for GHC? (does scc
show up in profiles?)
Does GHC really use Data.Graph? E.g., https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Data/Graph/Directed.hs seems like a copy/re-implementation. But, yes:
import qualified Data.Graph as G
...
scc :: IntGraph -> [SCC Vertex]
scc graph = map decode forest
where
forest = {-# SCC "Digraph.scc" #-} G.scc graph
...
So, let's look at these profiles...
from containers.
Good point.
from containers.
Yes it would be good to know how much time GHC spends in scc
.
If we want to improve it we could implement and see if Tarjan's or path-based algorithm (from Wikipedia: https://en.wikipedia.org/wiki/Strongly_connected_component#Algorithms) have a lower constant factor.
from containers.
Related Issues (20)
- Add laziness tests for Tree foldMap1 HOT 2
- Check time bound for graphFromEdges HOT 2
- Use a custom array type for SetM? HOT 6
- Different Links to OverloadedLists Extension HOT 1
- A more efficient Graph representation HOT 4
- Use generic map merging framework HOT 1
- Build fails with "Prelude.chr: bad argument" HOT 11
- Build of container-test fails with cabal HOT 8
- containers-0.6.4.1 and 0.6.3.1 fail to build with GHC-9.6.1 HOT 2
- Set difference and union in one HOT 4
- foldTree does not optimize well HOT 2
- Tree fusion HOT 16
- Fusible Set.fromDistinctAscList definition HOT 10
- Fusible IntSet.fromDistinctAscList definition HOT 3
- NonEmpty for CyclicSCC HOT 11
- better instance Hashable IntSet? HOT 8
- Unusual definition of foldrBits and foldlBits HOT 3
- Unnecessary CPP and C header in `Data.Map.Internal.Debug.html`?
- Release for GHC 9.8.1 HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from containers.