Skip to Content
Event Information

Graph algorithms in SAP HANA: on SFLIGHT and at TechEd

In the previous blog SAP HANA Graph visualizes SFLIGHT data we loaded SFLIGHT data into SAP HANA instance and created the graph workspace "SFLIGHT"."CONNECTIONS_C". Then using built-in Graph Visualizer in Database Explorer we could visualize the graph.

One more thing that the Graph Visualizer allows you to do is to understand and explore your graph by running most common graph algorithms: Neighborhood, Strongly Connected, Shortest Path. One more option is a pattern search using OpenCypher language, but we will leave it for the next blog.

So, let’s check these three algorithms. They are all available under Algorithms icon:

Strongly Connected

“A directed graph is said to be strongly connected if every vertex is reachable from every other vertex.” (source: help)

There is a subgraph where 14 airports are strongly connected, meaning we can leave from any airport in this set and arrive to any other airport from the same set.

THF is connected with FRA, but only with the inbound connection. And MUC is not connected to any other airport. Obviously, it is the same in reality, but now we are exploring the dataset loaded from SFLIGHT.


“…the neighboring vertices within the given radius (depth) from the given start vertices.” (source: help)

Let’s check what are direct flights from Singapore accordingly to this dataset.

The Shortest Path

“…the shortest path from the provided start vertex to the provided target vertex – also known as single-source single-target shortest path” (source: help)

Let’s check the shortest path from Tokyo to New York JFK using flight time as a weight attribute.

Attending SAP TechEd this year…

…and would like to learn more?

For SAP TechEd I prepared hands-on exercises to explore these and other aspects of SAP HANA graph processing based on some real life data. You can join CodeJam, mini-edition in the Developer Garage on the show floor.

You can join as well another CodeJam on the show floor that I prepared on processing of geospatial data in SAP HANA using SQL.

More details:

See you there, and – remember – do not use SFLIGHT sample data to schedule your flights!! 😉

-Vitaliy, aka @Sygyzmundovych

You must be Logged on to comment or reply to a post.
  • Nice blog!


    PS, i would remove TYO from sample data as it is a joint ‘fake’ name for two Tokyo airports: HND (Haneda) and NRT (Narita). TYO is not a real airport 🙂

  • This makes a lot more sense after your preview at the mini-code-jam session, especially with the small data set of vertices and edges. Can you please clarify your comments about Support Pack 3 features supporting this technology?