Question about the example of merging RAG from the tutorial

Hi there,
I have a question about the example of merging RAG. I just wondering how does the parameters are passed to the identified function max_edge. For example, I wanna merge the node of 1 and 3, as far as I concerned the ‘src’ and ‘dst’ are supposed to be 1 and 3, however, the result is 1 and 5. Moreover, after merging these 2 nodes, if we choose the max weights, the result should be 40 and 20 but we just got 40 and 10.image image

Probably, the example code has some mistake. If the merged node is represent a new node which append into to the graph, obviously, the edge of the new node to the other node shold be -inf. There is no sense to compare the exist weight with the new node.

You’re right, that’s a bug, the weights should be 20 and 40.

However, for your second question, the weight of the new node to existing nodes is given by the merge function given — that is the purpose of the function. I’m not sure why it’s failing. Could you please raise an issue at Thank you!

1 Like