For visualizing graphs dynamically