allowed empty weights in nodes and edges