(10 pts)
In this assignment, you’re going to generate a graph from an ordered list of integers. If your list has n integers, then your graph will have n vertices named
Vertex i will be connected to vertex j iff the i^{\text{th}} and j^{\text{th}} integers in your list share a common divisor.
For example, if my list is 4,6,5,6, then my graph looks like so:
To get your list of integers, choose your name from the following list:
Once you have your list of integers, tell us the following:
- What is your list?
- What are the edges of your graph?
- Give us a picture of your graph using Graphviz (see below).
- What is the order (or number of vertices) of your graph?
- What is the size (or number of edges) of your graph?
- What is the degree sequence of your graph?
- Does your graph have any cycles? If so, write one down.
- Is your graph isomorphic to a complete graph? If not, tell us one feature that distinguishes your graph from an complete graph.
Graphviz??
There’s an awesome program called Graphviz that automates the process of drawing a graph with a reasonable layout. Graphviz is built in to our forum and can be accessed via bbcode. To generate the graph above, for example, I simply typed in the following:
[graphviz]
graph{
layout=fdp;
0;1;2;3;
0--1; 1--3; 3--0;
}
[/graphviz]
Your graph will have 6 vertices so your code will look like so:
[graphviz]
graph{
layout=fdp;
0;1;2;3;4;5
# Put your edges here
}
[/graphviz]
Graphviz is a wonderful piece of software with lots of options. In the examples here, we’ve specified the layout
option, for example. Other choices for the value of layout
include dot
, circo
, and neato
. You can learn a lot more about Graphiz on it’s website, if you like.