I've defined the function, drawGraph, to display a graph as follows:
drawGraph[g_] := GraphPlot[g, VertexLabeling -> True, DirectedEdges -> True]
If I specify a graph via its edges, and then ask for a hamiltonian cycle, everything works fine as seen below
However if I specify a graph via its adjacency matrix, and then ask for a hamiltonian cycle, I'm told that the adjacency matrix is not a graph. However I can display the adjacency matrix as a graph using my drawGraph[] function as seen below.
Why does the drawGraph function interpret the adjacency matrix as a graph but not the FindHamiltonianCycle function? The same problem exists with all the other Path functions -- ShortestPath, EulerianPath, etc.





GraphPlotis an obsolete function from the time when Mathematica did not have theGraphdata structure, and there was no alternative but to use explicit but limited representations such as adjacency matrices. Having a data structure specifically for representing graphs is generally advantageous for programming. Why wouldn't you just useGraph? $\endgroup$