Virtual subgraph by attributes of nodes

Hello together,
i have a small graph like the following. A network of objects(nodes) with weight and forces as (relations black edges) nodes(objects) might have alternatives these are represented by a "alternative" relation (blue edges).

how can I query the subgraph containing the N4_ node with the maximum/minimum/... weight?

the resulting graph should look like the following:
(the resulting graph could be a virtual graph)

I hope my idea is clear enough.


an alternative base model could be the model below with different "Alternatives" Labeled Node N4_ . Not sure about if this makes things simpler

You're looking for weigthed shortest path algorithms. APOC library does have Djikstra and A* algorithms aboard, see You need to first lookup start and end node via a normal match and feed them into the procedure call.

The graph data science library does have these algorithms as well (plus many more), see