Course · Part of Graph Data Science

Path Finding with GDS

Find shortest paths in Neo4j using Cypher and Graph Data Science. Run Dijkstra and Yen graph algorithms on a weighted airport network, hands-on.

1 hour8 lessons across 3 modules
About this course

In this 1-hour course, you will learn

Path Finding with GDSAnalysing data through the structure of its connections. Also the name of the Neo4j library that implements it. teaches you how to find the shortest paths between pairs of nodesA vertex in a graph. In a property graph it can carry labels and properties. in a graph. You will solve routing problems on a real airport network, first with plain CypherNeo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it., then with the pathfindingA family of algorithms that find routes through a graph. What counts as the best route differs by algorithm. graph algorithms in the Neo4j Graph Data Science (GDS) library.

Shortest path questions are everywhere connected data appears: the fewest flights between two airports, the cheapest route through a logistics network, the quickest chain of introductions between two people. Graphs make these questions natural to ask, and pathfinding algorithms make them fast to answer. In around an hour, this course shows you both sides: when the built-in Cypher functions are enough, and when you need weighted graphA graph whose relationships carry a numeric property that algorithms and queries can read as a cost or a strength. algorithms such as DijkstraAn algorithm that finds the cheapest route between two nodes.'s and Yen's from the GDS library.

  • Shortest Paths

    Apply shortest path algorithms to find optimal routes between nodes in a real airport network, using both Cypher and the GDS library.

  • GDS Algorithms

    Run Dijkstra's and Yen's k-shortest-paths algorithms via the Graph Data Science library, configuring projections and interpreting result streams.

  • Weighted and Unweighted Relationships

    Understand how relationship weights affect path results and choose the correct algorithm mode depending on whether your graph edges carry cost properties.

  • Who this course is for

    This course is for analysts and data scientists who want to apply graph data scienceAnalysing data through the structure of its connections. Also the name of the Neo4j library that implements it. to routing and pathfindingA family of algorithms that find routes through a graph. What counts as the best route differs by algorithm. problems, and for developers who need to answer "how do I get from A to B?" questions over connected data and want to choose the right tool for the job. Every algorithm is introduced with a concrete problem from the airport dataset, so you see what each one is for before you run it. You should be comfortable writing basic CypherNeo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. queries and familiar with GDS projectionsAn in-memory copy of part of your database that graph algorithms run against. You choose which nodes and relationships it holds. and algorithm calls before you start; the prerequisite courses are listed beside this overview.

  • What you'll do

    This is a hands-on course. At the start you will create a Neo4j Sandbox, a cloud-hosted Neo4j instance pre-loaded with the Graph Data ScienceAnalysing data through the structure of its connections. Also the name of the Neo4j library that implements it. library and an airport routes dataset, and you will use it throughout the course.

    You will write and run every query yourself. Most lessons end in a challenge: you are given a routing problem, you write the CypherNeo4j's implementation of GQL, the ISO standard query language for graph databases. It is declarative: you describe the pattern to find, and the database decides how to find it. or the algorithm call to solve it, and GraphAcademy checks your answer against the database. You start with Cypher's shortestPath and allShortestPaths functions, which treat every hop as equal, then move to weighted graphsA graph whose relationships carry a numeric property that algorithms and queries can read as a cost or a strength. where each relationshipA named, directed connection between two nodes. Every relationship has a type, a start node and an end node. carries a cost, projecting the graph with GDS and running Dijkstra's algorithmAn algorithm that finds the cheapest route between two nodes. to find the single cheapest route and Yen's algorithmAn algorithm that finds the k cheapest routes between two nodes, rather than only the cheapest. to rank the k best alternatives. Because every challenge uses the same airport network, you can compare the answers directly and see how adding weights changes which route wins.

  • Where to go next

    After completing this course, you have covered one of the main categories of graph algorithms. Understand centrality algorithms explores another: measuring which nodesA vertex in a graph. In a property graph it can carry labels and properties. in a network matter most. To run pathfindingA family of algorithms that find routes through a graph. What counts as the best route differs by algorithm. and other graph algorithms as an on-demand cloud service, take Aura Graph Analytics fundamentals, where the projectionAn in-memory copy of part of your database that graph algorithms run against. You choose which nodes and relationships it holds. skills from this course carry straight over. When you are ready to validate your graph data scienceAnalysing data through the structure of its connections. Also the name of the Neo4j library that implements it. skills, the Neo4j Graph Data Science certification tests projections, algorithm selection, and result interpretation, including the pathfinding algorithms you practised here.