Add discrete detection and discrete color configuration for edge' weight