Define the weight attribute for all edges
Pack and unpack weights