# Minimum Weight Spanning Tree with different Relationships

Is it possible to compute an MST with different relationships, especially multiple edges between two nodes?

I tried to extent the example of the documentation (cf. below)

``````// Create Example Graph
CREATE (a:Place {name: 'A'}),
(b:Place {name: 'B'}),
(c:Place {name: 'C'}),
(d:Place {name: 'D', id: 'D'}),
(e:Place {name: 'E'}),
(f:Place1 {name: 'F'}),
(g:Place1 {name: 'G'}),
(h:Place1 {name: 'H'}),
(i:Place1 {name: 'I'}),
``````
``````// The following will run the Minimum Weight Spanning Tree algorithm and write back results:
// id is required for startNode
MATCH (n:Place {name: 'D'})
CALL gds.alpha.spanningTree.minimum.write({
nodeProjection: ['Place','Place1'],
relationshipProjection: {
properties: 'cost',
orientation: 'UNDIRECTED'
},
properties: 'cost',
orientation: 'UNDIRECTED'
}
},
startNodeId: id(n),
relationshipWeightProperty: 'cost',
writeProperty: 'MINST',
weightWriteProperty: 'writeCost'
})
YIELD createMillis, computeMillis, writeMillis, effectiveNodeCount
RETURN createMillis, computeMillis, writeMillis, effectiveNodeCount;
``````

The algo gds.alpha.spanningTree.minimum.write() computes a SpanningTree (cf. below),

but it did not write the costs of the relationship LINK1 in the new relationship MINST and it is not an MST, or it writes back the wrong cost.

Although

``````(d)-[:LINK {cost:4}]->(b),