00:05 Hamiltonian cycle is a problem of finding a cycle that visits every vertex exactly once in a graph. 02:32 There are multiple Hamiltonian cycles possible in a graph 04:47 Hamiltonian cycles are not possible in a graph that contains articulation points and pendent vertices. 07:18 The Hamiltonian algorithm starts from vertex 1 and tries to form a valid path. 09:47 The algorithm checks for cycles in an array. 12:09 The method is to use the mod function to get the values in a specific pattern. 14:23 There are two possible Hamiltonian cycles in the given example 16:34 The Hamiltonian cycle algorithm works by recursively checking for cycles in a graph. hope this helps
sir, you are a mind blowing teacher. While studying any of your tutorials, i have got no doubts though i had no prior knowledge on the topics. Thank you for making these videos.
Sir, I just want to say, that this is the first Indian scientist who teaches programming or mathematics with an accent I am willing to listen to. Great English, great explanation. Good Job!
Thankyou sir.With the help of your videos I am able to clear my daa paper almost.Whatever may be the result of it,your videos are always no1 for future reference too.🙏tqsm sir
Sir thank you. .your teaching was excellent. .what ever your concept logic is to good for student understanding. After watching your videos we are confident about the concept. .
I had never saw the content like that and the way you explain the algorithm is like a boom fire....Yeah I realize and it is true that if a teacher is expertise in that perticular subject then no one subject is hard for student.
Very nice explainations sir....This is first time studying,can't understand some topics in this subject...But ur class and explaination, give more clear and good pronounsation to understand...thankq so much sir...continue🙏
Exact same question, answer and method in my college notes means my teacher first watches Abdul sir's video and then teach us😂 Thank you Sir for such a good explanation 😊
Sir can you do a video on Edit Distance and Counting Inversion problems? I love your work and would really want to see these topics covered by you, you're simply magical
thank u so much sir.. you have outstandin way of teaching... finally i cleared on some other Daa topics by your lectures... once again thank you so much
Thank you so much sir! Made my day.. really was'nt able to find appropriate notes that articulates the main thing which is in fact way easier than rather complicatedly mentioned in regular classses.
Abdul Sir, you are explaining stuff really well. Can you make videos on Dynamic Programming and how to tackle those problems in top-down and bottom up approach!
I have written sample code for this problem. package bt; public class HamiltonianCycle { /** * Find all HamiltonianCycle solutions * @param graph * @param slots * @param slotCurrent * @param startVertex */ public static void find(final int[][] graph, int[] slots, int slotCurrent, int startVertex) { int[] connVertexes = graph[startVertex]; // Find all the branches a vertex can go deep in for (int point = 0; point < connVertexes.length; point++) { // We can use this point if (connVertexes[point] == 1) { // Use startVertex as the path slots[slotCurrent] = startVertex; try { // Rule2: Check if slots is full, this point should have an edge to the start point if (slotCurrent >= slots.length - 1) { if (checkConnectToStartPoint(graph, point, slots)) { printSolution(slots); return; } } else { // Rule1: This point should not be duplicate with point in slots if (checkDup(point, slots)) { continue; } // Move slots pointer // Go deep in this point find(graph, slots, slotCurrent + 1, point); } } finally { // Go to another branch, reset the slot use status slots[slotCurrent] = 0; } } } } private static void printSolution(int[] slots) { for (int i = 0; i < slots.length; i++) { System.out.print(slots[i] + 1); if (i != slots.length - 1) { System.out.print(","); } } System.out.println(); } private static boolean checkConnectToStartPoint(int[][] graph, int point, int[] slots) { // Get all the points to which this point is connected int[] connPoints = graph[point]; for (int pathPoint = 0; pathPoint < connPoints.length; pathPoint++) { if (connPoints[pathPoint] == 1 && pathPoint == slots[0]) { return true; } } return false; } private static boolean checkDup(int point, int[] slots) { for (int pathPoint : slots) { if (pathPoint == point) { return true; } } return false; } public static void main(String[] args) { int[][] graph = new int[][]{ {0, 1, 1, 0, 1}, {1, 0, 1, 1, 1}, {1, 1, 0, 1, 0}, {0, 1, 1, 0, 1}, {1, 1, 0, 1, 0} }; int[] slots = new int[graph.length]; find(graph, slots, 0, 0); } }
Dear Sir, It will be very nice and easy for us to do self study. If you use some Algorithms from CLRS or Sartaj Sahani,to explain the problem. We love your tutorials, Thank You
00:05 Hamiltonian cycle is a problem of finding a cycle that visits every vertex exactly once in a graph.
02:32 There are multiple Hamiltonian cycles possible in a graph
04:47 Hamiltonian cycles are not possible in a graph that contains articulation points and pendent vertices.
07:18 The Hamiltonian algorithm starts from vertex 1 and tries to form a valid path.
09:47 The algorithm checks for cycles in an array.
12:09 The method is to use the mod function to get the values in a specific pattern.
14:23 There are two possible Hamiltonian cycles in the given example
16:34 The Hamiltonian cycle algorithm works by recursively checking for cycles in a graph.
hope this helps
so useful, thx a lot
👏🏻👏🏻👏🏻
Thank you ❤
Thank you bro❤
Thank u so much Abdul Bari Sir..Your Channel is helping a lot to our CSE & IT Department :)
Physics students too by learning classical algorithms and trying to find an efficient quantum algorithm for the same problem.
You Indians! You are amazing! Thank you for your help. Best Regrads from Turkey!
love from india
indians have no understanding of the material
@@SuperMaDBrothers which material ?
I just realised my teacher watches your videos first and then teaches us😂🤦♂️
Same here😂😂
same here... our teacher even recommended us to watch his playlist
@@ZapySolo, your teacher is a good person.
All teachers who watch him and then teach are good learner's ...
lol same
He is absolutely the clearest teacher on RUclips and other online sources. Thank you so much
6 years and still one of the best playlist to learn algorithms
sending love and respect from EGYPT, thank you
sir, you are a mind blowing teacher. While studying any of your tutorials, i have got no doubts though i had no prior knowledge on the topics. Thank you for making these videos.
Too much respect Teacher from Ethiopia ❤❤❤😊😊
I watch your videos first thing in the morning , as they say, To make your whole day better do something good after you wake up.
What a wonderful explanation.
Keep going sir. Students needs teachers like you.
-bangalore
Sir, I just want to say, that this is the first Indian scientist who teaches programming or mathematics with an accent I am willing to listen to. Great English, great explanation. Good Job!
Just awesome sir.......can't express your help sir throughout my DAA journey....a lot of respect for you sir.....🙏🙏🙏🙏
Hello how are you 😊
Paying lakhs to college but still studying in RUclips 🤧
Bcoz RUclips does not give you the degree
Sir, You are Pride of Data Structures and Algorithm! A Big Thank You :)
Your algorithm playlist is really so helpful and pretty clear for complex ones, thanks a million sir.
welcome
Thank you very much ! Your video helped solving one of the major challenges to the project we are doing !
There’s a direct entry ticket reserved fr u in heaven fr making me to understand this concept fr my tomorrow algorithm exam 🙃
After watching your explanation there is no chance to dislike....
Tqq sir
So you were disliking before, without watching the video?
this man is exact definition of "teacher"
Sir you explain these algorithms so perfectly. I really thank you for helping us in building a strong foundation of algorithms.
You rock, Sir. Complex concept is explained simply and clearly.
u stand
Vidyaniketan students,hit the thumbs here to show thankfulness to sir at the last moment.
Thankyou sir.With the help of your videos I am able to clear my daa paper almost.Whatever may be the result of it,your videos are always no1 for future reference too.🙏tqsm sir
watching this class from brazil, amazing teacher!
my teacher directly playing this playlist in class.
😂
Thank you sir, 🙏🏼 you explained well as nobody else did yet..but it is a NP - complete problem!
Sir thank you. .your teaching was excellent. .what ever your concept logic is to good for student understanding. After watching your videos we are confident about the concept. .
I had never saw the content like that and the way you explain the algorithm is like a boom fire....Yeah I realize and it is true that if a teacher is expertise in that perticular subject then no one subject is hard for student.
Thank you so much Sir! You do an amazing job at explaining these concepts. Much appreciation in the US!
do u understand hindi
As always the best teacher on internet!!
I just realised that this is the only way to learn my subject because our teacher never teaches us
i had given up on exams, until i saw your tutorials sir thankyou very much :)
Assalamua'likum, sir. Love from University of Dhaka. Your explanation is way too good Alhamdulillah, and really helpful as well.
You make complex things dead easy... Kudos Sir
Abdul, based on the information in Corman's book, Travel Salesman and H-Cycle problems are NP-Complete. 1:30 you mentioned it's an NP-hard problem
NPC is both NP-hard and NP problem
For Revision start at : 7:00
sir i always found everyone blessed you for what you are doing
This will help me in my semesters which is due tomorrow!!
great teaching skill. simply rocking sir,
this is some epic stuff !! the way of explanation is just amazing !
u are the teacher of our teacher's
best explanation ever
Gr8 work sir
very nice and clearly explained..
Wow the best explanation anyone can give. thank you so much.
I wish you would show us the code for every other problem like you do in this particular one. Very nice explanation!
Really, impressive. You explained perfectly.
Is it me or does this video look normal in 2x speed??????
you not alone.
*simply,rocking sir*
i realised that our college teachers teach us after learning from these videos
You are amazing! Thank you for your help. Best Regrads from syria
thanks for the algorithm... love your teaching style Sir..
Very nice explainations sir....This is first time studying,can't understand some topics in this subject...But ur class and explaination, give more clear and good pronounsation to understand...thankq so much sir...continue🙏
This way of describing algorithm is very easy to understand
I want to be a teacher like you....your vedios help me a lot to teach DAA.☺
I just realised i watch your videos first and then teach my teacher
I wish I had a sir like this irl
Exact same question, answer and method in my college notes means my teacher first watches Abdul sir's video and then teach us😂
Thank you Sir for such a good explanation 😊
you are the best teacher i have ever seen
Thank you so much sir......it was the best explanation one could ever get
Great job sir....!! Tqsm for making Daa so simple and easy to understand!
Wow amazingly clear explanation. Very good teacher
Thanks sir today my design and analysis of algorithms exam they asked this question . ❤
thank sooo much! explained so clear for us students.您配享太庙。
Sir ur videos Are very helpful for us....
great teaching sir👍👍👍
I am preparing for the exam. Thank you so much for your lesson.
Teacher of Teachers.
Sir can you do a video on Edit Distance and Counting Inversion problems? I love your work and would really want to see these topics covered by you, you're simply magical
doing in 9 mins
Sir thank you very much for making it understable and easy
It was clear and clean,thanks a lot sir
thank u so much sir.. you have outstandin way of teaching... finally i cleared on some other Daa topics by your lectures... once again thank you so much
Thank you so much sir! Made my day.. really was'nt able to find appropriate notes that articulates the main thing which is in fact way easier than rather complicatedly mentioned in regular classses.
Thank you, thank you, thank you, thank you sir. you are a god sent
Very helpful and good explanation 👍
keeping spreading knowledge and love sir.... Thanks for this video course.
Abdul Sir, you are explaining stuff really well. Can you make videos on Dynamic Programming and how to tackle those problems in top-down and bottom up approach!
Clearing my subjects with good marks only because of you and gate smashers 😂🛐
14:00 the explanation of algorithm
Thank you very much. I don't think anyone could explain it in better words.
you are always with me in my shower before an exam. 🚿
He's also with me in the exam 😊
Let me also join 😄, ill also bring mausam 👉👈
@@syedaaryan5985STAY AWAY from my mausam. he makes me wetter than the shower
You are the saviour sir😊
Best ever explanation.....Thanks sir.....😇😇😇😇
sir your teaching style is very nice i am underatanding easily keep it up sir
a goldmine in youtube
Thank you sooo much sir .... Just made it very clear ❤❤❤❤❤❤
I wish google had a double like or triple like option for ur videos
thank you, uni student from syd.
Thanks, you carried my assignment :D
It was really really helpful. Thank you so so so much.
I loved your teaching techniques sir.
Keep going.
Thanks a lot abdul sir . Liked that you explained the written code as well. Pls try and do it for all problems .
I have written sample code for this problem.
package bt;
public class HamiltonianCycle {
/**
* Find all HamiltonianCycle solutions
* @param graph
* @param slots
* @param slotCurrent
* @param startVertex
*/
public static void find(final int[][] graph, int[] slots, int slotCurrent, int startVertex) {
int[] connVertexes = graph[startVertex];
// Find all the branches a vertex can go deep in
for (int point = 0; point < connVertexes.length; point++) {
// We can use this point
if (connVertexes[point] == 1) {
// Use startVertex as the path
slots[slotCurrent] = startVertex;
try {
// Rule2: Check if slots is full, this point should have an edge to the start point
if (slotCurrent >= slots.length - 1) {
if (checkConnectToStartPoint(graph, point, slots)) {
printSolution(slots);
return;
}
} else {
// Rule1: This point should not be duplicate with point in slots
if (checkDup(point, slots)) {
continue;
}
// Move slots pointer
// Go deep in this point
find(graph, slots, slotCurrent + 1, point);
}
} finally {
// Go to another branch, reset the slot use status
slots[slotCurrent] = 0;
}
}
}
}
private static void printSolution(int[] slots) {
for (int i = 0; i < slots.length; i++) {
System.out.print(slots[i] + 1);
if (i != slots.length - 1) {
System.out.print(",");
}
}
System.out.println();
}
private static boolean checkConnectToStartPoint(int[][] graph, int point, int[] slots) {
// Get all the points to which this point is connected
int[] connPoints = graph[point];
for (int pathPoint = 0; pathPoint < connPoints.length; pathPoint++) {
if (connPoints[pathPoint] == 1 && pathPoint == slots[0]) {
return true;
}
}
return false;
}
private static boolean checkDup(int point, int[] slots) {
for (int pathPoint : slots) {
if (pathPoint == point) {
return true;
}
}
return false;
}
public static void main(String[] args) {
int[][] graph = new int[][]{
{0, 1, 1, 0, 1},
{1, 0, 1, 1, 1},
{1, 1, 0, 1, 0},
{0, 1, 1, 0, 1},
{1, 1, 0, 1, 0}
};
int[] slots = new int[graph.length];
find(graph, slots, 0, 0);
}
}
Father of ADA 🙏
impressive sir,u'll reach heights sir
Best Classes for DAA.
U r truly a great guy sir, respect
Dear Sir, It will be very nice and easy for us to do self study. If you use some Algorithms from CLRS or Sartaj Sahani,to explain the problem.
We love your tutorials,
Thank You
True..It'd be a great lecture by a 'gem' then!!Simply great
Completing syllabus in corona pandemic... 🗣️🗣️
keep going...build some stuff
Amazing teach Daizuki desuuu
Amazing explanation, Thank you!
Thanks for teaching very well with smile face .we understand your teaching..if you please say important semester year qns of daa