Because somethings can only be blogged about…, for everything else there is Github.

Main menu

Tag Archives: Graph Theory

Post navigation

Finally finished the hectic summer project at ISI. To be frank, it was definitely a unique experience. Learned a hell lot of things. I started working about a month and a half back. My mam handed over to me a paper at first. I read it, tried to understand it. Was succesful to some extent, but you can’t expect a second year computer enthusiast to understand fully 3 chinese scientists’ years of work in a fifteen page compressed document, full of notations and symbols I rarely saw before and concepts which I never heard of even in a single book I’ve read before. When nothing seemed to get in my mind, I chose the evergreen method of understanding concepts – try it and check it out. Took examples and applied what that document proposed and then tried to makeout something from the result. Surprisingly, it matched to what I expected and that was the beginning of learning up (read ‘mugging up’) of the concepts. Finally went to mam to see her after 2 days but got a shock when mam said to me – “Its been just 2 days and you finished it? You’re a genius.” I felt guilty, because only I and my partner sumit, knew how we studied that paper. I told myself, mugging up the concepts just won’t work! Later on, came another paper, and then another, one after the other and yet again. Read alteast 6-7 papers before I knew what exactly I was trying to do. After knowing the problem statement, we started working upon the solution. All that hours of brainstorming and thinking process led to a solution to that problem. A logical solution, which seemed to be correct at first sight. I checked it and again , out of ecstacy that I got a solution to a research problem. But somehow, didn’t see a single flaw in it and so started to code it. Then came one of the biggest kela of my life. Coding in my project was a big part because an efficient implementation of an algorithm you thought for an NP class problem, takes a lot more of your brain. After writing the first 500 hundred lines, and ofcourse after removing the compilation errors, I executed it. And then came the most simple, impeccable and yet pristine output – “SEGMENTATION FAULT”. Thats it! Thats all for the 500 lines of code I wrote. Then came the horrific session of debugging, and after 8 hours, I was still at the same spot I was before. I was at the verge of chewing up my hair when I found that bug. The most stupid bug and yet difficult to spot by eyes. I used a “=” sign instead of a “==” sign in an ‘if’ condition. What the hell ! If you’re thinking this was the “kela” I was talking about you’re wrong. I fixed it, compiled and ran the code and the intermediate results came fine. So started coding further and finally my code finished at around 800 lines. Again few errors, wrong outputs, but luckily no ‘segmentation faults’, I was able to get the correct output. Tested it for a few cases, answer ‘seemed’ to be correct. I couldn’t have ever known for sure about the answer because no one ever solved the problem with a proper algorithm before. There was no one to compare my results with and so did a hand-check and found it was correct. But couldn’t do a hand-check for graphs with hundreds of nodes. So just “assumed” the results are correct. More than 70% of the time I got for my summer project was over by now. Deadline was 10th July because that was the day I reserved my train. It was June end, when just by chance, I tested my code with a simple graph – which I just modified a little by adding 1 node at the center. For those who know, it was a “web” graph and I put a node at the center of it and connected it with surrounding nodes. I didnt know what class that graph belonged to, so named it the “bomb” graph. And to my horrid luck, it really came to be a bomb, infact an ATOMIC BOMB for my code. My code simply messed that simple graph. It made a junkyard out of it. It literally teared it, destroyed it, annihilated the graph. I was with my jaw down. Felt sad, everything’s over now. The entire algorithm is scrapped. Time’s almost up, and I’m again to square zero. But didn’t lose hope ( p.s. I have seen Shawshank Redemption ), and with my teammate started that thought process again but with little hope that we’ll able to finish it before deadline. But the next algorithm was an obvious algorithm. Almost similar to that I used for hand-checking. Not exactly a brute force, but like an optimised version of brute force. But it was polynomial time. What else can you expect for an NP-hard problem? It worked ! For almost every graph it did. But there was a forbidden graph for that code too – the “Bipartite Graph”. But excluding that graph, the code was working fine on other graphs. Finally submitted it to mam. Just 5 days left and the entire report was left to be written. It took 3 days to write a 45 page report. 8th July, almost the end of the journey. I and my friends in Kolkata started planning about places to visit in the next 2 days. We made a list of places – Victoria memorial, Science Center, Park Street, etc. Then came the next “kela”. Mam showed us a website, about something called ISAAC 2009. It was an international conference in USA about graph algorithm. Mam wished to send our work to that conference. She told us to write a paper and gave us the format. If accepted, it’ll get published in LNCS journal. Now, that’s something cool. But then I came to know about the deadline – 15 July. Came back to reality from my day dreams and cancelled all the plans we made for the next 2 days. Just sat in room and wrote the paper. After 2 drafts and 3 reviews, mam accepted it at 10 July 6:00 pm, and my train was at 10:00 pm. I ran, took the bus to salt lake and reached there at 7:00 pm and then finished the packing and by 7:30 pm I was in a taxi heading towards the Howrah station. At 8:15 pm, I was there and straighforward went to a food stall. I didnt eat much, just 2 Chicken Pizzas, 1 Veg Pizza, 1 Cold Drink and then Lays and then coffee. I hadn’t eaten anything for past 2 days. The day mam told us about the paper, I didnt had the time to breathe. Forgot sleep, food, music, just remembered typing and thinking and typing and thinking. The best part, I had an AC coach reservation. Slept as soon as I entered the coach and woke up 1 hour before I was arriving at my homecity bhilai. So that was my Kolkata experience. Never realized when it was all over. In the last few days, time was going at jetflash speed. I never knew when hours were gone and I was still typing sitting at that position. My stomach surrendered, as it knew I wasn’t going to feed it no matter how much creepy sound it makes. That was a summer project. But fruits of that hardship is yet to be recieved. Certificate is not with me as the Dean was absent the day we were going and the paper is yet to be accepted. I’m only hoping I get my certificate and the paper gets published. Atleast that I deserve for that 45 days of toil. Now i’m sitting at home, in my comfy bed and writing this post. Life is all about working and then relaxing for me, enjoyment being implicit.