Given graph, how could i represent it using adj matrix?. I have read lots 开发者_Python百科of tutorials, post, slides, etc but i cant get my head round it, i just need that little push.
I am trying to implement an adjacency matrix in java that will produce an output for a Hamiltonian cycle, which can then be solved with different algorithms such as kruskurals, djikstras and the 2opt
Graph < Integer, Integer> g = new SparseMultigraph<Integer, Integer>(); g.addVertex(1);g.addVertex(2);g.addVertex(3);
What is better, a开发者_如何学Pythondjacency lists or adjacency matrix, for graph problems in C++?