Session Ready
Exercise

Build and explore the network (part 2)

A network built using igraph can have attributes. These include:

  • Network attributes: properties of the entire network
  • Node attributes: properties of nodes
  • Tie attributes: properties of ties

In this exercise, we will explore all these types of attributes.

igraph and the variable g containing the network are already loaded into the workspace.

Instructions
100 XP
  • Give the name "Madrid network" to the network. Then print the network name attribute.
  • Set a node attribute id as the sequence from 1 to the number of nodes of the network. Then print this id attribute.
  • Print the tie weight attribute.
  • Print the network. Can you spot the different types of attributes?