updated general graph class definition