COMP4900/5900: Graph Analytics
$\newcommand{\R}{\mathbb{R}}\DeclareMathOperator{\E}{\mathbf{E}}\DeclareMathOperator{\deg}{deg}\newcommand{\N}{\mathbb{N}}$

Assignment 1

Programming for this assignment should be done in Python 3 using the igraph library with some data visualization coming from matplotlib.

This searchable reference for python-igraph is useful.

You are to submit this assignment in Brightspace as a single zip file, with the following structure:

<student_id>/<input_graph_1>
<student_id>/<input_graph_2>
<student_id>/part1.py
<student_id>/part2.py
<student_id>/analysis.txt  (only for students in COMP5900)

If you find yourself struggling with technical issues related to using Python, igraph, or matplotlib, please feel free to ask questions on the Brightspace course forum. There are probably other students experiencing the same issues.

1. Exploratory Analysis

Choose two social network graphs each with at least $10,000$ vertices. One place to find these is the Stanford Large Network Dataset Collection, but you can also take any other data you are able to find, as long as the data comes from something that could broadly be considered a social network. Treat your graphs as undirected, with no self-loops, and no parallel edges. (Be sure to eliminate self-loops and parallel edges if they are present in the data.)

Write a program with the name part1.py that reads each of the graphs into an igraph.Graph object. Your program should print out basic information about each graph, including

Your program should also compare the two graphs by printing (side-by-side) their

Your program should end by using matplotlib to display one plot that gives the degree histogram of each graph as a bar chart using a different colour for each graph.

It will be helpful, for the next question, if you structure your program so that most of this is done in one function that takes two graphs as input and does this comparison.

2. Comparison with Random Graphs

Choose the most interesting of the two graphs from the first question and use it for this part. Write a second program called part2.py that compares your chosen graph to each of the following graphs, in the same way the first part of the assignment compares your two chosen graphs:

3. Analysis of Results (only for students enrolled in COMP5900)

If you are enrolled in COMP5900, include a text file analysis.txt that discusses your findings. It should include