use one var to represent bidirection edge