This lab will give a quick example-based introduction to basic ideas in graph theory, network science, and the concept of patient similarity networks (PSN) using NetworkX - a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.
If you have a subscription to ChatGPT Plus, you can also try out the the Medical AI Assistant (UiBmed - ELMED219 & BMED365) and see if you can get it to answer some of your questions related to graph theory, network science and patient similarity network, cfr.[here].
- Hva er grafteori og hvordan defineres en graf? (answer in English, please)
- Hva menes med "nettverk-vitenskap"?
- Hva karakteriserer et "patient similarity network" og hva kan det brukes til?
( compare the responses to the prompts above using the UiB-internal https://chat.uib.no )
| Notebook | 1-Click Notebook |
|---|---|
| 00-introduction-slides.ipynb A short introduction to Graph theory, Network science and Patient similarity networks for medical students - an AI-assisted notebook prompted and created in "15 minutes" with cursor and claude-3.5-sonnet. |
|
| 01-networkx-tutorial.ipynb You can use NetworkX to construct and draw graphs that are undirected or directed, with weighted or unweighted edges. A large collection of functions to analyze graphs is available. This tutorial takes you through a few basic examples and exercises |
|
| 02-patient-similarity-networks-iris.ipynb Rather than patient-derived data, we are using the famous IRIS flower dataset with 4 different measurements from each of the 150 flowers - construction and exploring the "IRIS Flower Similarity Network" |
|
| 03-patient-similarity-networks-ibs-brain.ipynb Patient Similarity Networks using data from the paper Brain morphometry and cognitive features in prediction of irritable bowel syndrome [preprint] (https://github.com/arvidl/ibs-brain) |
See also the GraphTheory-and-ComplexNetworks notebooks:
- 1-Introduction.ipynb
- 2-Fundamentals.ipynb
- 3-Extensions.ipynb
- 4-Network-topology.ipynb
- 5-Network-analysis-centrality.ipynb
- 6-Network-analysis-across-time.ipynb
A. Lundervold & the Medical AI Assistant: Elements of graph theory and patient similarity networks (PSN) - A short introduction for ELMED219+BMED365 [PDF] [$\LaTeX$]
For medical and biomedical students new to graph theory, the following online tutorials and resources provide a gentle introduction:
-
Khan Academy Introduction to Graph Theory: A beginner-friendly series covering basic concepts and applications. Khan Academy Graph Theory
-
Graph Theory Tutorials by Sarada Herke: A YouTube playlist offering visual and intuitive explanations of graph theory concepts. Sarada Herke's Graph Theory Tutorials
-
Introduction to Graph Theory for Medical Students: Notes generated by Gemini Advanced 1.5 Pro with Deep Research
As Jupyter Notebook is quite new to many of you, you may want to skim through some tutorials. Here are two:
- https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/index.html
- https://www.datacamp.com/community/tutorials/tutorial-jupyter-notebook
Spend some time playing around with the provided examples. You'll find some questions for you to investigate in the notebooks. If you're already familiar with graphs and networks, you can try your hand at more advanced examples or, even better, help out other less experienced team members.

