我有以下neo4j数据库设计:
** 课程和技能都没有线性/依赖性。例如。没有必要修课程A才能修课程。
我想解决的问题:
鉴于工作节点#3(具有技能#1,#2和#3),可以采取哪些课程来获得这些技能(按最少课程数排序)?即如果您想在Job X工作,您可以采取哪些课程选项/路径来获得所需的技能?
示例数据:
CREATE (PythonProgramming:Course { name: 'python_programming'})
CREATE (DataScience:Course { name: 'introduction_to_data_science'})
CREATE (MachineLearning:Course { name: 'machine_learning'})
CREATE (Statistics:Course { name: 'statistics'})
CREATE (Regression:Course { name: 'regression'})
CREATE (Python:Skill {name: "python"})
CREATE (Probability:Skill {name: "probability"})
CREATE (LogisticRegression:Skill {name: "logistic_regression"})
CREATE (Google:Job {name: "google"})
CREATE
(DataScience)-[:HAS_SKILL]->(Python),
(DataScience)-[:HAS_SKILL]->(LogisticRegression),
(DataScience)-[:HAS_SKILL]->(Probability),
(MachineLearning)-[:HAS_SKILL]->(LogisticRegression),
(MachineLearning)-[:HAS_SKILL]->(Probability),
(Statistics)-[:HAS_SKILL]->(Probability),
(PythonProgramming)-[:HAS_SKILL]->(Python),
(Regression)-[:HAS_SKILL]->(LogisticRegression),
(Google)-[:REQUIRES_SKILL]->(Python),
(Google)-[:REQUIRES_SKILL]->(LogisticRegression),
(Google)-[:REQUIRES_SKILL]->(Probability)
根据这些数据,Google上Job的最短路径应该是: