Skip to content

Latest commit

 

History

History
 
 

Graph Analysis

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Travelling Salesman Problem in Snowflake

1. Overview

This example demonstrates how to use Snowflake's User-Defind-Table-Functions (UDTFs) to solve the Travelling Salesman Problem. The UDTF makes use of a library called NetworkX which includes many graph algorithms that can be used in Snowflake's UDTFs.

2. Prerequisites

  • Snowflake Account
  • Snowpark for Python
  • The examples also use the following Python libraries:
    networkx
    pandas
    matplotlib
    urllib
    requests
    geojson
    gmaps
    
  • Jupyter or JupyterLab

3. What you'll learn

  • How to use Snowpark for Python to create User-Defined-Table-Functions (UDTFs)
  • How to do graph analysis with Snowflake UDTFs

4. Usage/Steps

  1. Open terminal and clone this repo.

    git clone https://github.com/Snowflake-Labs/snowpark-python-examples

  2. Update creds.json to reflect your snowflake environment.

  3. Change to the Graph Analysis directory and launch JupyterLab (or Juypter)

    jupyter lab

  4. Paste the URL in a browser window and once JupyterLab comes up.

  5. Run the cells of the Notebook.