Am I fucking stupid? Is graph colouring supposed to be this hard?
First year CS student here. In high school we did coding in C++, simple algorithms, and I even got 96.5% on that final. So far in uni, I've mostly been doing ok even if I struggled somewhat bc we are coding in Java now.
Well, it was my job for the group project to write the algorithm that takes the adjacency matrix of a graph, and finds the chromatic number. I went over it logically. I go over each row. When I find a 1, it means there is an edge between these two nodes, i and j. I go to that node and check its "neighbours", so I dont give j a colour it cant have. If I cant find one, the number grows. Simple. It worked on the example. It worked on a random small cyclic graph I made, and a tree graph, and a complete graph etc.
Today, ONE DAY BEFORE THE DEADLINE, we got some text files with the test graphs. HALF OF THEM FAILED. A colleague who worked on getting the edges from a txt file and making the matrix said that the code doesn't work for some graphs, and the other teammate who was supposed to work on the code (and didn't, lol) texted "so the code doesn't work???", verbatim. Theoretically, I hsve more experience in programming than my teammates, since I had comp sci in high school, AND YET IT SEEMS I AM A FUCKING EMBARASSMENT, AND MY CODE, THE DEFINITION OF A BROKEN CLOCK BEING RIGHT ONCE PER HOUR.
I have one night to fix this shit and maybe not every student in the city will realize that I have more teeth than braincells. The graphs have upward of 400 nodes, so I cant even manually check why the fuck it gives me a wrong answer. I'm thinking of doing it again from scratch because I genuinely do not have some effortlessly genius creative thinking out of the box solution with sprinkles and a cherry on top. Which is a fucking shame. If I make no progress by 4 a.m. I will tape some A4 pieces of paper and start fucking drawing like the dumbfuck neandethal I feel like every day all day
How the fuck will I explain a shitty grade in the big project to my family, 2 generations of engineers have come before me, my parents went to a harder uni under communism and did not complain, did not fail. How fucked socially will I be when people will realize that not only am I awkward at best, annoying at worst, I am also a liability to have in your team? FMLLLLLL