How to mathematically prove that a topological ordering on a cyclic graph will topologically sort its Strongly COnnected Components?

Let's have a standard topological ordering algorithm (from CLRS):

Topological_ordering(G)
    foreach vertex v in V do
        v.color = white
    
    for each vertex v in V do
        if v.color = white then
            Stack = DFS(G, v, Stack)
    return Stack

// DFS

DFS (G, v, Stack)
    v.color = gray
    for each u adjacent of v do
        if u.color = white then
            Stack = DFS(G, u, Stack)
    v.color = black
    Stack.push(v)
    return stack

Now let's apply this to a cyclic graph G.

We will not have a topological ordering of the vertices of G, but we shall have a topological ordering of the graph of the Strongly Connected Components

>The graph of the Strongly Connnected Components derived from the graph G is a graph in which each SCC is represented by only one vertex (also called compressed SCC graph

Example

For example let's look at this graph: https://imgur.com/a/0EXOxJt (sorry for the poor drawing skills). In green the SSC of this graph.

Applying the algorithm above, one possible stack configuration is:

head ----> 2 ; 3 ; 4 ; 5 ; 1 ; 6 , 8 ; 7 ; 9

As you can see the elements of an SCC are "all together". How to prove this mathematically? Thank you.

πŸ‘︎ 16
πŸ’¬︎
πŸ“…︎ Dec 19 2021
🚨︎ report
Kosaraju algorithm - strongly connected components

I don't understand why the stack in this algorithm is needed. there is a stack which you do DFS and insert all vertices when they finish to the stack.
instead of a stack why not do a for loop over all vertices and do DFS if they are not visited?
why the algorithm is not like that:

  1. Reverse all the edges
  2. for loop over all vertices {
    if vertex is not visited then {
    print "new strongly connected component:"
    DFS(vertex)
    }
    }
πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/papamamalpha2
πŸ“…︎ Oct 05 2021
🚨︎ report
Kosaraju’s Algorithm for finding Strongly Connected Components, Experimenting with TypeScript 4.0's Variadic Tuple Types (Variadic Kinds), Flatter wai mailchi.mp/f92da32573d5/0…
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/pekalicious
πŸ“…︎ Jul 14 2020
🚨︎ report
Library of generic (yes, generic) basic graph algorithms: data structures, BFS, DFS, MST, topological ordering, strongly and weakly connected components, bipartion, shortest paths, maximum flow, Euler walks. godoc.org/github.com/your…
πŸ‘︎ 56
πŸ’¬︎
πŸ‘€︎ u/korthaj
πŸ“…︎ Mar 02 2018
🚨︎ report
I can't understand why a corner case for Tarjan's strongly connected components algorithm does work.

So, I am trying to solve a SCC problem, and come across this algorithm. I am basing myself on this wiki link and this video (he starts to talk about the part I am in doubt at 15:13)

So, I still haven't implemented on code, because I'm still trying to understand how some stuff work, and how I will need to change some stuff from both sources, since they are in pseudo-code. But I ran through paper the case 0R1, 1R2, 1R3, 3R0, and came to find that node 2 would be wrongly assigned as part of the component because of this line:

if(ids[at] == low[at]):
    //...
    low[node] = ids[at]

So, before I thought this line was just redundancy, because I couldn't find a case where it would be useful, but now, it's even starting to make mistakes on the code!

I know this is a highly specific question, and it's poorly presented, but I just thought I would try my luck, thanks to anyone that spends time trying to understand this thing!

πŸ‘︎ 13
πŸ’¬︎
πŸ‘€︎ u/El-Bigode
πŸ“…︎ Aug 25 2018
🚨︎ report
Problem on Strongly Connected Components [Graph] imgur.com/a/XR97v0y
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/achie27
πŸ“…︎ Mar 04 2019
🚨︎ report
Computing Strongly Connected Components in Python

EDIT: SOLVED!!!

you can see scc.py and scc2.py through the github link. scc.py runs in minutes, and scc2.py runs in hours

the difference is using a defaultdict(list) to track the groups. I will create another post to ask why it makes such a big difference.

So, I'm taking Algorithms1 through Coursera at the moment. And the last homework was to compute strongly connected components of a graph. I was able to achieve this, but the runtime of my algorithm was in hours- other people on the forum claimed to do it in under a minute.

my implementation with the actual dataset and some test sets can be seen here

https://github.com/hennymac/Algorithms1/tree/master/Week4

I would really appreciate any help

*note: I had to adjust the maximum recursion depth in order to accomplish this.

class Track(object):
    """Keeps track of explored, time, source, leader, et cetera"""
    def __init__(self,explored):
        self.explored = explored
        self.current_time = 0
        self.current_source = None
        self.leader = {}
        self.finish_times = {}

    def addNode(self,node):
        """adds node to SCC group"""
        self.leader[self.current_source] = self.leader.get(self.current_source,[]) + [node]

def scc(graph,reverse_graph,nodes):

    explored = [False for i in range(len(nodes))]
    track = Track(explored)
    dfs_loop(reverse_graph,nodes,track)
    sorted_nodes = sorted(track.finish_times, key=track.finish_times.get,reverse=True)
    explored = [False for i in range(len(nodes))]
    track = Track(explored)
    dfs_loop(graph,sorted_nodes,track)
    return track

def dfs(graph,start,track):
    track.explored[start] = True
    track.addNode(start)
    for edge in graph[start]:
        if not track.explored[edge]:
            dfs(graph,edge,track)
    track.current_time += 1
    track.finish_times[start] = track.current_time


def dfs_loop(graph,nodes,track):
    for node in nodes:
        if not track.explored[node]:
            track.current_source = node
            dfs(graph,node,track)    
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/henny_mac
πŸ“…︎ Nov 21 2014
🚨︎ report
Computing Strongly Connected Components of a Graph scienceblogs.com/goodmath…
πŸ‘︎ 28
πŸ’¬︎
πŸ‘€︎ u/nglynn
πŸ“…︎ Oct 31 2007
🚨︎ report
How big is the largest strongly connected component of the web?

I'm not sure if this is the right place to ask, so tell me if you think there is a better subreddit

According to this link: http://www9.org/w9cdrom/160/160.html the main SCC of the web was over 50M pages in 1999. Is there any source that tracks this currently?

Would scaling 50M by some growth factor provide a reasonable estimate? I'm not sure if this is a valid thing to do on SCC because the number of interconnected websites is not necessarily proportional to the total amount of information on the web...

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/disconnectedLUT
πŸ“…︎ May 01 2014
🚨︎ report
[Postgrad algorithms in graph theory] Strongly connected components

Hello, first off, let me say that I am not looking for a complete solution, but merely for a few hints that could help me accomplish the task. Posting here because I'm completely stumped and have no idea how to solve this myself.

The task is as following:

We are given a directed acyclic graph. Each vertex of this graph is assigned a value. By reversing the direction of an edge, the graph may no longer be acyclic, therefore strongly connected components may appear after this action. We are supposed to find such an edge whose reversal will create a strongly connected component whose sum of the vertex values is the maximum possible.

And here is the catch: this algorithm has to run in linear time.

Obviously, there's the bruteforce approach which tries reverting every edge one by one and then runs Kosaraju–Sharir or Tarjan's algorithm on the graph, but we end up with a O((V+E)E) complexity, which invalidates this approach.

I believe there's a possibility that this algorithm can be solved by a modification of one of the algorithms, or with the help of topological ordering of the graph (every DAG has a topological order). But maybe I am wrong and have to take an entirely different approach to this.

Any insights or hints would be very welcome. I want to figure this out myself, but I need some sort of a push. Thanks.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Tarjan69
πŸ“…︎ Oct 16 2015
🚨︎ report
Making Graph Algorithms Fast using Strongly Connected Components scienceblogs.com/goodmath…
πŸ‘︎ 33
πŸ’¬︎
πŸ‘€︎ u/nglynn
πŸ“…︎ Oct 24 2007
🚨︎ report
Is the name Angelica too strongly connected to "Rugrats"?

Whenever I mention the name Angelica, people usually state that the name has a bratty imagery and feel to it. Some people believe that the name carries that aura on its own whereas a lot of people associate with the character named Angelica on the cartoon "Rugrats" who was very unruly and mischievous.

Certain names are so strongly associated with pop culture references that it ends up kind of overpowering the name itself i.e. Casper. Is Angelica the same?

πŸ‘︎ 180
πŸ’¬︎
πŸ‘€︎ u/QuickAquarianOne
πŸ“…︎ Dec 25 2021
🚨︎ report
I heard interesting analysis. due to chip related semiconductor was short, there was solar panel shortage last year . but component shortage mostly gone this year, so silver will be demanded very strongly.

https://www.youtube.com/watch?v=OFdVicdk8Xw

from around 11:00

I hope 2022 will become silver year. knowledgeable persons foresee strong silver's future, for example First Majestic silver and Endeavour silver reserve silver in their storages.

πŸ‘︎ 79
πŸ’¬︎
πŸ‘€︎ u/hitosi52
πŸ“…︎ Jan 09 2022
🚨︎ report
Homemade wooden rack for my hdd allowing airflows from all side (also at the bottom) and all direct point of connection if covered by rubber stream to reduce vibrations and noise. The hdd is strongly stuck between the rubber streams on both side and bottom. Total component cost 10 dollars
πŸ‘︎ 27
πŸ’¬︎
πŸ‘€︎ u/ItsAgainOnlyMe
πŸ“…︎ May 01 2021
🚨︎ report
Rewatching S7 and struggling to get through it again… It dawned on me why this season is so hard to watch. Not just for the writing but because it fractures the very thing that I connected with so strongly the rest of the series. The comfort of their friendship.

Anyone familiar with the concept of a β€œcomfort show”?

For me, it dawned on me that not only are the potentials often kind of annoying, but the whole season really separates the core Scoobs like never before. We see way less moments of them together because of all the new cast additions, and you know… Empty Places. I’m sure many of us love this show because we wish we had a tight knit group like the Scoobies. The show empowered me and helped me feel less alone. I’ve always been a huge sucker for anything with close-knit group dynamics (like Harry Potter and the trio, no not that Trio, I mean Harry, Hermoine and Ron) and season 7 completely obliterates that comfort aspect of the series.

And that’s what Buffy brings me… comfort. But not S7…

So, if S7 is your least favourite, do you relate to this reason? What’s your reasoning behind liking S7 the least?

πŸ‘︎ 112
πŸ’¬︎
πŸ‘€︎ u/darklinksquared
πŸ“…︎ Nov 14 2021
🚨︎ report
My sa is strongly connected with my perfectionism

That's it. Wonder if u have any thoughts

πŸ‘︎ 32
πŸ’¬︎
πŸ‘€︎ u/ed3n21
πŸ“…︎ Nov 28 2021
🚨︎ report
Total noob, how are these components connected on the circuit board? Can't tell if the circuit board is one where each row is connected by a strip or if each hole is individual.
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/aklarkbps
πŸ“…︎ Jan 29 2022
🚨︎ report
β€œRival teams believe Toronto is interested in acquiring a star talent, with nobody on the roster deemed untouchable, and they have been among the teams most strongly connected to Ben Simmons.” - @JeremyWoo twitter.com/thenbacentral…
πŸ‘︎ 204
πŸ’¬︎
πŸ‘€︎ u/The_Living_L
πŸ“…︎ Jul 26 2021
🚨︎ report
Modelling strongly connected request/response pairs

I have an application where I communicate with a backend whereby a specific request type always results in a specific response type. I'd like to model this in types, somehow.

Something like:

export type RequestResponsePair =
| { request: { type: "init", param: number }, response: { "success": boolean } }
| { request: { type: "close", force: boolean }, response: { "closed": boolean } }

Meaning that if I send an `init` request, I always need to specify a `param`, and I will always receive a response with a `success` boolean. And if send a `close` request, I need to specify a `force` boolean, and I'll receive a response with a `closed` boolean.

My TypeScript-fu is fairly weak, so I was wondering how to model these types so that I can create some kind of `send` function, like:

function send<T extends RequestResponsePair>(request: ???): ??? {...}

And the usage would be:

const response = send({ type: "init", param: 123});
console.log(response.success);
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/supersagacity
πŸ“…︎ Nov 18 2021
🚨︎ report
It's 1:30 AM. Just finished the game in VR. I have never felt so strongly connected to a game. I am a nomai now.

Good lord that was an amazing experience. For those of you with the option to play in VR, I highly recommend it! I'm reeling with what a beautiful experience that was. I'm a habitual gamer and have played just about everything but this game has elevated my opinions about what is possible in the medium. It is so interesting to play a game that's core mechanic is learning and knowledge!

Thank you Mobius. Any game of yours is an insta-buy for me.

I cannot believe how smart this game is. It broke my brain and hit my right in the feels. It's a rainy weekend here and I guess tomorrow I'll try to figure out how to begin the Echoes of the Eye content.

I actually tried the game a couple of years ago but got frustrated and gave up. I'm so glad I stuck with it this time. The immersion provided by VR definitely helped. I also really did require a few nudges (so thank you to this sub for the attention given to spoilers). I was also playing this in my non-native language which I think caused me to miss a few clues. It did however deepen the sense of deliberate attention and problem-solving needed to figure things out. Spoilery stuff:

  • >!I had pretty much everything else solved and was convinced I had to forge a warp core and then deliver it via teleportation to Ash Twin. I had envisioned steps that don't exist and don't make sense (powering up the high energy lab to somehow power the black hole forge, e.g.) The root problem was that I never figured out how to teleport into the core of Ash Twin itself. I even spent a full cycle just sitting there on the warp pad, thinking maybe it was a direct teleport to the Eye itself, but I would just step out of the way when the sand spout would pass because I had already learned that it sucks you back to the Ember Twin. !<
  • >!I had to find a couple of nudges to realize that the quantum moon changed depending on which planet it was orbiting. After I figured that out I finally managed the associated riddles there. I probably flew to the quantum moon 10x and kinda wandering around trying to get ideas. It seems very obvious with hindsight. !<
  • >!When I cracked the quantum moon and saw that freaking LIVING nomai just standing there I felt intensely uneasy but also shouted with excitement. Like what in the ever living hell! I sat there reorganizing her communication tiles for a full cycle before looking up that you actually have to prompt her into making two pedestals to use. That was one of my favorite end of cyc
... keep reading on reddit ➑

πŸ‘︎ 19
πŸ’¬︎
πŸ‘€︎ u/CatLourde
πŸ“…︎ Nov 06 2021
🚨︎ report
How come Caspian is the only post rock band so far that’s strongly connected with me?

Something about Caspian really hits home with my tastes. Godspeed You! Black Emperor is cool but i don’t listen to them much. Explosions in the sky have some cool songs. I like a bit of God Is An Astronaut. But none of it really has the feel Caspian has. I think it’s cause I prefer the more upbeat and melodic kind of Post Rock, not the slow and melancholic stuff that Godspeed has.

πŸ‘︎ 30
πŸ’¬︎
πŸ‘€︎ u/redheaduprising
πŸ“…︎ Sep 12 2021
🚨︎ report
An unexpected find from an old Enter the Matrix cutscene video that looks strongly connected to the new Matrix movie, What do you think? youtu.be/RNbYopzcRAA?t=22…
πŸ‘︎ 23
πŸ’¬︎
πŸ‘€︎ u/refaelha
πŸ“…︎ Sep 21 2021
🚨︎ report
What you guys think about my little Small Ship Building Station? (Has welders connected to inventory manager that automatically builds components i need)
πŸ‘︎ 17
πŸ’¬︎
πŸ‘€︎ u/Silbias
πŸ“…︎ Dec 30 2021
🚨︎ report
IOEN Partners with Holo! A crucial component has been the use of open source Holochain code. With IOEN and Holochain's business entity, Holo, the connection is still going strong. medium.com/internet-of-en…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/agorrupitcu
πŸ“…︎ Dec 02 2021
🚨︎ report
[Woo] Rival teams believe Toronto is interested in acquiring a star talent, with nobody on the roster deemed untouchable, and they have been among the teams most strongly connected to Ben Simmons. /r/nba/comments/orz4mp/wo…
πŸ‘︎ 42
πŸ’¬︎
πŸ‘€︎ u/cpseybold1
πŸ“…︎ Jul 26 2021
🚨︎ report
Do you know some crime strongly connected to media?

Hi there

I'm interested if any of you know about some interesting crime case which is somehow strongly connected with any kind of media (social media, press media.. doesn't matter - I just need the connection)

It would be great if the case was super interesting, maybe morbid or controversial (even occult stuff would be interesting)

But! It needs to be connected with media (doesn't matter if the media itself was involved or it happened on the media - just any connection)

If you have any ideas, tell me. I'll appreciate it!

Thanks for reading and have a great day!

(Just to explain why I'm asking - I need it for my presentation for 'medial communication')

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/emo-softie
πŸ“…︎ Sep 29 2021
🚨︎ report
I am strongly considering turning my first fan edit (Gooby: Requiem for a Fractured Soul) into the first installment of a loosely connected trilogy. I'd like to call it the "Fractured Requiem" trilogy. More info in the comments.
πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/GH1studios
πŸ“…︎ Oct 09 2021
🚨︎ report
"STRONGLY CONNECTED"
πŸ‘︎ 112
πŸ’¬︎
πŸ‘€︎ u/lucaindainternet
πŸ“…︎ Sep 10 2021
🚨︎ report
Connected components workbench HMI

Just a quick question due to the fact off me being pretty nee to CCW. Why does CCW not like any white in images made as .png? Also why doesn't it show the transparency?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Creepy_Radish1289
πŸ“…︎ Dec 28 2021
🚨︎ report
Bought a motherboard locally, seller conveniently failed to disclose that there was a component not connected on the rear side. Need help identifying it, if it's worth fixing, etc.

Howdy all

I bought this asrock x399 fatal1ty motherboard off someone on offerup, however as soon as I pressed the power button the board started smoking. After doing a quick visual on the board it appears they failed to tell me that an SMD on the back of the board was broken off the board (it didn't look "blown" but I don't really know what I'm looking at). was just labelled R10 and I have been unsuccessful in finding what part it could be, as I haven't gotten any real matches. The closest I've gotten is finding a 250mW current sensing resistor (RL1220S-R10-F) but it didn't look the same. The smoke seemed to be coming from the same side as the broken part so I'd wager that it was causing the issue but if anyone else has any thoughts I'm all ears.

Here's a photo of the board and how it was originally attached.

I tried contacting the seller on offerup but they basically told me to pound sand. If anyone here knows anything about this I'd be forever in your debt if I'd be able to find the component and solder it back on. Also on a somewhat related note, one side seemed to have two metal leads coming out of it and the other side only had one, but on the mobo itself both sides seemed to have only one contact.

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/uhwhatisjalapenos
πŸ“…︎ Nov 27 2021
🚨︎ report
Connected components workbench 4-20ma singal.

So I'm just starting to dabble in CCW and the micro800 series. Not entirely sure how I feel about it. So features are nice..... so not so much. One issue I've been having for days is getting my analog outputs to take my 4-20ma singal. I'm using the OF4 analog output extension.Is there anything special I need to do? Any scaling, or initiating?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Creepy_Radish1289
πŸ“…︎ Dec 21 2021
🚨︎ report
[Day 9]Connected components

Can basins merge together in a larger basin?

Edit: I just need to read. The answer is NO.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/vraGG_
πŸ“…︎ Dec 09 2021
🚨︎ report
IOEN Partners with Holo! A crucial component has been the use of open source Holochain code. With IOEN and Holochain's business entity, Holo, the connection is still going strong. medium.com/internet-of-en…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/hylokca
πŸ“…︎ Dec 02 2021
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.