A course on Network Science, including network formation models, structural patterns, and dynamic processes.
This project is maintained by chatox
Introduction to Network Science (2025/26), UPF
Do not simply right-click on the file names below, or you will download an HTML file that will not be readable by Cytoscape. See how to download in the README of the
practicum/data/
directory.
What you should deliver is explained at the end of each practice handout. In short, it is a 9-pages report.
Basic concepts:
Advanced concepts:
Cytoscape is an open source software platform for visualizing complex networks and integrating these with any type of attribute data.
Let’s start with a simple case: Zachary’s Karate Club, which captures 34 members of a karate club at a university, with links representing interactions between members outside the club.
File > Import > Network from File ...
karate.gml
Layout > Compound Spring Embedder
Tools > Analyze network
(do not check “directed”) and look at the Node table
displayed under the graphAdd > Text Annotation...
). Put the text in red so that we can see.Do not use screenshots; use File > Export as image
The second network we look at represents the collaboration between university students for homework assignments in the “Computer and Network Security” course at Bar-Gurion University. The data incorporates different types of interaction (e.g. partnerships, sharing computers) and its structure was used to predict students’ grade on the course exam.
File > Import > Network from File ...
student-cooperation.graphml
Layout > Prefuse Force Directed Layout
File > New Network > From selected nodes, all edges
Select > Nodes > Largest Subnetwork
function useful.)Note: you can zoom in and zoom out with the mouse scroll wheel, you can also use the panel on the bottom-right of the screen to navigate the graph.
Reminder: do not use screenshots; use File > Export as image
You do not need to include anything from this part (Part 2) in your report.
Reload the Karate Club dataset (karate.gml
).
Now you can play with the “Style” panel (top-left, between “Network” and “Filter”) and the various properties. Here are some ideas.
To style the entire networks in different ways:
To include in each node its name:
To remove these names, remove the mapping (trash can icon).
Note that node names might not be visible in large graphs until you zoom in. This is controlled by the setting under View > Always Show Graphics Details
.
To change the shape of nodes:
To change the width of edges:
Try some layouts (under the Layout
menu), for example:
Degree Sorted Circle Layout
Edge Weighted Spring Embedded Layout > EdgeBetweenness
Prefuse Force Directed Layout > EdgeBetweenness
You do not need to include anything from this part (Part 2) in your report.
Look at the results from the network analysis in the “Analyzer” panel on the right. (If you cannot see them, try View > Show results panel
or re-run Tools > Network Analysis
.)
Note: If prompted to install “cyPlot app” select “yes” (otherwise). If you get an error like “Can’t find app ‘cyplot’”, try again after saving the session, closing Cytoscape, and re-opening.
The Marvel Universe Social Graph contains characters from the Marvel Universe that appear in the same comic number. It contains over half a million edges. It is formatted in the following way:
BLACK PANTHER/T'CHAL<tab>HAWK
BLACK PANTHER/T'CHAL<tab>LOKI [ASGARDIAN]
BLACK PANTHER/T'CHAL<tab>HULK/DR. ROBERT BRUC
SPIDER-MAN/PETER PAR<tab>HULK/DR. ROBERT BRUC
...
To import it into Cytoscape:
File > Import > Network from File...
marvel-hero.csv
Tip: change the style to “minimal” to see the graph better.
[REPORT] Include this graph in your report.
[REPORT] What are the top 20 nodes with the largest degree?
File > New Network > From selected nodes, all edges
[REPORT] Indicate the number of nodes and edges of this sub-graph, it appears on the left panel next to the name of the network.
Important: by default Cytoscape has a level of detail setting that is similar to the one found in videogames. If the current view contains more than render.nodeLabelThreshold, the node labels are not displayed. You can toggle between full details and reduced details using
View > Always Show Graphics Details
or the rhombus icon at the bottom of the network view panel. You can also permanently adjust this by going to Edit > Preferences
. Depending on the computer, you can set this up to 2000 from the default of 200. Be careful: this will block your computer when dealing with large networks.
Now we will practice creating small networks.
We will create a network from two spreadsheets. The first one, got-characters.csv
, contains the name and house of the characters in the series Game of Thrones by George R. R. Martin. The second one, got-relationships.csv
contains relationships between characters.
First we import the edges:
File > Import > Network from file ...
got-relationships.csv
src
: “Source Node” (it’s a green disc)dest
: “Target Node” (it’s a red target)Now we import the node attribute:
File > Import > Table from file ...
got-characters.csv
Next, style the network:
Tools > Analyze Network
)[REPORT] Include the graph of Game of Thrones.
[REPORT] Select and extract a graph containing one clique of four or more characters. Indicate which characters are involved, and style the edges so that they show as label the relation between the characters.
[REPORT] Show two examples of a multi-edge in this graph. Indicate which characters are involved. Extract the corresponding (2-nodes) subgraphs.
[REPORT] Describe any observation you can make about how node attribute “house of birth” is distributed in the graph.
Now, create a network on your own using CSV files, on whatever topic of your choice as long as the network is real. You will need two CSV files: one for the network and one for the attributes. The network should include between 20 and 30 nodes.
Some ideas:
These are only ideas. Be creative!
Tip: to include a legend, you can use the Cytoscape app legend creator.
[REPORT] Describe the graph you created.
[REPORT] Include two tables with the contents of the CSV files you created (not screenshots).
[REPORT] Draw the graph in Cytoscape and include it in your report.
First of all, read delivering your report on the evaluation guidelines, and check your report against those guidelines before submitting.
Deliver a brief report of at most 9 pages (it can be less!!), in PDF format. Organize your report as follows:
Please be brief, you do not need to write too much; your report can be less than nine pages. A “brief commentary” means one or two paragraphs.
Your report should end with the following text:
I hereby declare that all of the text, tables, and figures in this report were produced by myself.