When compiling the graph, add the weights if a relation appears more than once in the source file.