Ad-hoc networks and the theory of graphs and networks