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.
- Snowflake Account
- Snowpark for Python
- The examples also use the following Python libraries:
networkx pandas matplotlib urllib requests geojson gmaps
- Jupyter or JupyterLab
- How to use Snowpark for Python to create User-Defined-Table-Functions (UDTFs)
- How to do graph analysis with Snowflake UDTFs
-
Open terminal and clone this repo.
git clone https://github.com/Snowflake-Labs/snowpark-python-examples
-
Update
creds.json
to reflect your snowflake environment. -
Change to the
Graph Analysis
directory and launch JupyterLab (or Juypter)jupyter lab
-
Paste the URL in a browser window and once JupyterLab comes up.
-
Run the cells of the Notebook.