Added optional float weight to edges