Implementation of attributes genericity for costfunctions.py. Change edge from a 3-tuple to a 2-tuple.