I get graphs and perhaps some graph algos (maximal flow etc) but I've never used a graph DB. Is this really how it works, cos what you're describing sounds more like some kind of generic-optimiser-in-a-box
I'd say it's more about query language, and what types of queries the DB is optimized for. Graph DBs come with query languages that let you directly ask questions like "starting from node $foo, select all nodes and edges that lead to node $bar, but only for paths consisting of edges with property $xyz > 42".
An example from Neo4J documentation:
MATCH p =(charlie:Person)-[* { blocked:false }]-(martin:Person)
WHERE charlie.name = 'Charlie Sheen' AND martin.name = 'Martin Sheen'
RETURN p
which, per documentation, "returns the paths between 'Charlie Sheen' and 'Martin Sheen' where all relationships have the blocked property set to false".
Graph DBs are designed for modelling your data as nodes with properties, connecting by directed edges, with properties, to another nodes; they're also internally optimized for doing such queries.
An example from Neo4J documentation:
which, per documentation, "returns the paths between 'Charlie Sheen' and 'Martin Sheen' where all relationships have the blocked property set to false".https://neo4j.com/docs/cypher-manual/current/clauses/match/#...
Graph DBs are designed for modelling your data as nodes with properties, connecting by directed edges, with properties, to another nodes; they're also internally optimized for doing such queries.