generage graph with port number and per-port connection