I am working with a graph in Memgraph that has weighted edges. I’d like to set up a trigger that will keep track of the total weight of all edges in the network.
Here is an example of the graph structure:
- Nodes represent different cities.
- Edges represent roads between these cities.
- Each edge has a weight that signifies the distance between two cities.
For instance:
(A)-[10]->(B)
(B)-[20]->(C)
(A)-[15]->(C)
In this example:
- The edge between A and B has a weight of 10.
- The edge between B and C has a weight of 20.
- The edge between A and C has a weight of 15.
The total weight in this example would be 45.