Graph Colouring Problem - Backtracking

preview_player
Показать описание
We go over the infamous graph colouring problem, and go over the backtracking solution!
Рекомендации по теме
Комментарии
Автор

Can't see how the code will backtrack as there is no resetting of color. It seems more of a greedy approach that we always try to color the graph with minimum color possible.

namanjain
Автор

I think it would be m^n possible ways to color n nodes with m colors.
(From the video it is in 2:10 to 2:25 )

saifulislamsalim
Автор

Great video man! the clarity! the explanation! :D

dhananjaywithme
Автор

minor mistakes but you are a life savior man

sairohit
Автор

But the algorithm will check all the colors for each vertex even if all nodes are colored. because on returning from last node, the for loop of calling function is still running.

ShantanuShinde
Автор

how can the diagnals be set as 1 of an adjacency matrix ..it is always 0..

rahullakhotia
Автор

In the code, you set x[k] = c;
But I don't see the step of backtracking, I don't see where you reset the color if you want to go back ?

truongvanloc
Автор

Thanks Sir! Understood the solution in one go.💯

starkendeavours
Автор

A really good explanation as well as clean code

tirthjayswal
Автор

Why is this a backtracking problem? We are not making any changes in the previous node's color

guruprasadc
Автор

In the future you could use 'a', 'b', 'c', 'd' for node names and 'red', 'green', 'blue' for color names so you don't have to use 0, 1, 2, 3 for everything - it would make this video even easier to understand

stcenturydigitalje
Автор

loved the explanation, thnkuuu so much for the video, it was really helpful

DeveshSehdev
Автор

your adjacency matrix is wrong from 0 to 0 there is no edge so it should be 0 not 1 and similarly for 1 to 1 and others

VC-kjyx
Автор

very clear. organizing helps a lot.
thanks very much, such big help.

AABB-fbzy
Автор

awesome dude, really cool explanation and the graphics were also pretty helpful. Thanks !!!

thedeependpsycho
Автор

does this solution work for big and more complex graphs lets say for example if we want to color the map of Europe with no more than 4 colors ?
i know that Europe can be colored with 4 colors but does that recursive method would make it possible?

ceciivanov
Автор

thanks for this good video it helped me to understand programming logic more better

Nikhil
Автор

What if I want to find out all possibilities of coloring ? all valid combinations ?

fs
Автор

This is amazing explanation. thanks :)

debayanmitra
Автор

Would the time complexity of this algorithm be (m*n)^n ? Since the for loop in the isSafe function would run n times in every iteration?

ojaspandav