Edge weights and vertex colours