making EdgeGraph class independent of Field type