graph theory - Solving a weighted network flow using Neo4J -
graph theory - Solving a weighted network flow using Neo4J -
i have bipartite graph (guy , girl notes) nodes connected weighted edges (how compatible girl-guy pair is) , each node has capacity of 5 (each guy/girl can matched 5 people of opposite gender). need find best possible matching maximize weights.
this can formulated weighted network flow - each guy source of 5 units, each girl sink of 5 units, , each possible arc has capacity of 1 unit. problem can solved either using linear programming, or graph traversal algorithm (such ford–fulkerson).
i'm looking possible solutions using neo4j - have thought how go it? (or should go linear programming solution...)
i think this. find 5 compatible
relationships ordering weight of relationship in descending order , create them separate relationship match
.
match (guy:guy)-[rel:compatible]->(girl:girl) guy.id = 'xx' guy, rel, girl order rel.weight desc limit 5 create (guy)-[:match]->(girl)
neo4j graph-theory linear-programming graph-traversal
Comments
Post a Comment