change the condition for multiplication in Graph.