First working version
Generating graph only in adjacency matrix mode.
working : common and directed graph, weighted edges