Add graph with pairs