Tabriz-Talayi's blog

By Tabriz-Talayi, history, 7 days ago, In English

I was recently tasked with finding a way to calculate SCCs in a directed graph by a teacher expecting me to reach Tarjan's or Kosaraju's algorithm, but I reached a completely different and new solution (the novelty Im not fully sure).

It's arguably a bit worse in both simplicity and complexity, but I decided to write a blog about it anyway since I think I used some cool ideas, and who knows, maybe somebody else can utilize this either to find a useful variant or in some completely unrelated problem.

My teacher named it KS-SCC, hinting at the fact that it's dumb/useless (in Farsi), lmao.
I think it's funny, so I will stick with it.


Prerequisites

Idea & Intuition + Proof of KS-SCC

Implementation of KS-SCC

KS-SCC Test Results (Complexity & Correctness)

I might have made a bigger deal out of this than it is but it was really fun for me to write this blog so I hope it was worthwhile.
I did not find anything similar by doing a quick search online but if anybody found an earlier discovery of the same solution they can share in the comments.

I checked everything I said multiple times to make sure whatever I said is correct, but I'm relatively in the beginning of my CP journey(8 months in) so if a more experienced coder can check what I said, I would truly appreciate it.

Also, I'm not technical enough and don't even think I have the required specs to run my own tests so I used ChatGPT for testing KS-SCC, and was overjoyed to see it outperformed Tarjan and Kosaraju at least for $$$n, m \lt = 10^5$$$ but I am not sure how trustworthy it is so if anybody is willing to test my code I will be eternally grateful.

This is the first version of KS-SCC and I did not spend much time on optimizing it, for instance I think the up[] array can be fully eliminated.

So I'm open to any and all suggestions for edits & optimization.

UPD1:
Im examining it along with DFS Tree to come up with a simpler explanation, In the meantime if anybody is struggling on grasping the concept i will be happy to answer any questions they have in my messages.
Im also attempting to write the full proof myself but take this with a grain of salt since I doubt I would be able to come up with and adequate proof.

And btw does anybody know what are the requirements on making it into Catalog? Is it even possible for me given that im a specialist?
If anybody has any info on this i would be extremely thankful if they could help me.

  • Vote: I like it
  • +57
  • Vote: I do not like it

»
6 days ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Tabriz-Talayi (previous revision, new revision, compare).

»
6 days ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Tabriz-Talayi (previous revision, new revision, compare).

»
6 days ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Tabriz-Talayi (previous revision, new revision, compare).

»
6 days ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

next target to reach : Find the Chromatic number of a graph

»
6 days ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

And congratulations on finding a new algorithm . its really admirable. be gold

»
6 days ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Tabriz-Talayi (previous revision, new revision, compare).

»
6 days ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Tabriz-Talayi (previous revision, new revision, compare).

»
6 days ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

idk why this is being downvoted

OP, you should read about DFS trees, they'll give you more insight here

»
6 days ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Tabriz-Talayi (previous revision, new revision, compare).

»
6 days ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

mashala shir

»
6 days ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

ماشاالله آقا تبریز

»
6 days ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Benazam bi nazir bood

»
6 days ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

I am so proud of you

»
6 days ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

eshghi tabriz jooonam

»
6 days ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

mashala agha tabriz