Блог пользователя Tabriz-Talayi

Автор Tabriz-Talayi, история, 7 дней назад, По-английски

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.

  • Проголосовать: нравится
  • +57
  • Проголосовать: не нравится

»
7 дней назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
7 дней назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
7 дней назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
7 дней назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
7 дней назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

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

»
7 дней назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
7 дней назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
7 дней назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

idk why this is being downvoted

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

  • »
    »
    7 дней назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Thank you, i will look into it

»
7 дней назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
6 дней назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

mashala shir

»
6 дней назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

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

»
6 дней назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Benazam bi nazir bood

»
6 дней назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I am so proud of you

»
6 дней назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

eshghi tabriz jooonam

»
6 дней назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

mashala agha tabriz