Getting Started with DukeGuess


Contents


Requirements

DukeGuess comes in the form of a Java executible jar file. This means that you need to have the most up-to-date version of the Java Runtime Environment in order to use DukeGuess.

If you need to download the Java Runtime Environment, you may do so here: http://www.java.com/en/download/manual.jsp


Downloading and Installing DukeGuess

Installing DukeGuess is a fairly straightforward process. The first thing you need to do is download the DukeGuess zip file. Do that by right clicking here and selecting "Save Link As..." Make sure you remember where you save the file. If you are using Internet Explorer, you should click "Save Target As..." instead of "Save Link As..."

Now locate the DukeGuess.zip file and extract it. When you extract the files, WinZip will automatically create a folder called "DukeGuess" where you told it to extract, and place all the files you need within that folder.

Now you are ready to start using DukeGuess!

Opening a Graph

In order to start manipulating graphs using DukeGuess, we first need to get a graph opened! In this example we will open up a graph representing the characters and relationships between characters in the first season of the popular show "24".

Start DukeGuess by double clicking on "DukeGuess.jar" in the "DukeGuess" folder.

s

DukeGuess now displays a file loader box. First, click the button labeled "..." and then select the file called "twentyFour.gdf". Then click "Ok"

You should now have a graph that looks something like this:


Basic Functions

What you see now is the main DukeGuess application. You will be doing all of your graph manipulations from this screen. The area showing blue blocks and green lines is called the Visualization area. In the visualization area you can zoom in and out, move nodes (squares) and edges(lines), and move the "camera" around.


Go ahead and try these things out now with our "24" graph! If you need to re-center the graph, click on the "Center" option underneath the "Display" menu at the top.
In order to move nodes around, first click on the "Manipulate Nodes" button at the very bottom of the DukeGuess window. Now if you left click a node, you can drag it around to a new location. You can also change the size of nodes.
The Manipulate Nodes Button

The white area below the visualization area with the ">>>" prompt is called the Interpreter. The function of the Interpreter is to take Python code commands and use them to manipulate the way the graph looks, or to found out more information about the graph. We will go into more detail on how to use the interpreter later.

Viewing More Information

In order to view more information about the graph, go to the "Display" menu at the top and click on "Information Window". DukeGuess now displays an information window to the left. When the mouse hovers over a node or edge, the information window will display detailed information for it in this new window.

Different Layouts

When DukeGuess first loads a graph, it automatically loads it with the "random" layout. This means that nodes placed at random locations within the window. While the random layout can have interesting results, it is generally not the most helpful for examining the structure of a graph. Fortunately, DukeGuess has several built-in layouts that are interesting to view and simple to run. To access them, go to the "Layout" menu at the top of the window and select the layout you desire. In this case, lets select the "GEM" Layout. It is a good layout that organizes things nicely.

Select the GEM Layout

Your graph should look like this after running the GEM Layout

For those who are not a fan of the show, Jack Bauer is the main character who often saves the day. Place your mouse over nodes and see if you can find a node named "Jack". As you can see, he holds a relatively central place in the graph.

Saving your Graph

To save all the work you have done to your graph, go to the "File" menu and select "Export GDF". Although it is recommended that you save your work as a *.gdf file, you can name the file anything you would like.

Node Functions Panel

The Node Functions Panel is an addition to DukeGuess that allows you to easily access different properties of nodes. This section will describe how to open up the panel and explain each of its different uses.

Opening the Panel

To open the panel, go to the "File" menu at the top of the window, and select "Run Script...". You should open the "nodeScript.py" file in the DukeGuess folder.

This will add a panel to the bottom of your DukeGuess window that contains several buttons and a small text box. It looks like the image below

Using the Panel

Selecting Nodes

Using the Panel is fairly simple. Before you may use any of the buttons, though, you must select a node. You may do this in two different ways: either click on a node, or type its name into the text box and hit enter (Note that capitalization DOES matter). This will make the node "selected" and turn its color red. To select a different node, simply click on a different node or enter a different name into the text box. To clear a selected node without selecting another, click on the "Clear Current Node" button.

Jack is selected

Outdegree and Betweenness Buttons

The buttons labeled "Get outdegree" and "Get Betweenness" operate in similar ways. Once you have selected a node, if you click on the outdegree button the outdegree of the selected node is printed to the text box. If you click on betweenness, the betweenness is printed to the text box.

For more information on outdegree and betweennness, see their Wikipedia articles: Degree on Wikipedia and Betweenness on Wikipedia

The outdegree of Jack is 9 (his betweenness is 309.83)
Highlight Neighbors

This is a simple button that allows you to highlight all the selected nodes neighbors. A neighbor is a node that is directly connected to the selected node. This button will turn all the neighbors orange. If you would like to return them to their original color either click the "Clear Current Node" button or click on a different node.

Jack with his neighbors highlighted
Highlight Nodes X Edges Away

This button is a more powerful version of the "Highlight Neighbors" button. Instead of highlighting just neighbors, you can dictate the distance away a node must be from your selected node in order to be highlighted orange. For example, if you select "2" for Jack, but it will select all the neighbors for Jack's neighbors whom Jack does not have a connection with. These nodes are a distance of 2 away.

When you click on the "Highlight Nodes X Edges Away" button, a box comes up asking you to enter the distance you would like to highlight. Either enter a distance or type "all". If you type "all", something a little bit different will happen. Instead of highlighting nodes at just one set distance, the program will highlight nodes at every distance according to their distance. For example, neighbors will be highlighted one color, nodes 2 away will be highlighted another color, nodes 3 away another color, and so on. Nodes that are not reachable from the selected node (a distance of infinity) will be highlighted black. A color key also pops up to help you identify the colors.

Type in all to get a color gradient

Below is what the "24" graph looks like if you do an "all-Highlight" on Jack:


The Grouping Buttons

The last two buttons, "Save Group" and "Clear Group" have a specialized function. If you hold the shift key and left click on a node, you'll notice it changes color to a light blue. This means the node has been added to a group. To deselect a node from the group, shift-click it again.If you would like to save this group click on the "Save Group" button. If you would like to completely clear the list, click on the "Clear Group" button.

Any groups that you save will be available for use in the Interpreter for the rest of your DukeGuess session.

Put Jack, Kim, and Victor into a group called "group1"


Using the Interpreter

The Interpreter is the most powerful part of the Guess program, but it is also the most complicated to learn how to use. It allows you to access the different qualities of individual nodes, groups of nodes, edges, and the entire graph.

In this section, code that you should type into the Interpreter will be in italics and seperated from the rest of the text.

Go ahead and bring the Interpreter back into view by clicking on the "Interpreter" tab at the bottom of the Guess window.

Accessing Attributes

Attributes are something that we have alluded to so far, but have not throroughly described. Both edges and nodes have several different attributes associated with them. This is the information that is displayed in the Information Window when you hover over a node or edge. We can also access this information using the Interpreter. We do this by using the '.' (dot) operator. For example, to access Jack's color, we would type:

Jack.color

The Interpreter then prints out Jack's color. Go ahead and try it. In this case, Jack's color is blue.



In order to access edges, we need to type a little more. In DukeGuess, edge's are defined by their end nodes. DukeGuess uses the "-" symbol to represent the edge between two nodes. For example, an edge between Jack and Kim would be represented as "Jack-Kim" or "Kim-Jack". We can then access this node's color by typing:

(Jack-Kim).color

We have to put "Jack-Kim" within parenthesis because the '.' operator has a higher priority than '-'. This means that DukeGuess would try to find an edge between Jack and Kim's color (which is green) instead of first finding the edge between Jack and Kim, and then finding that edge's color.


Changing Attributes

It is also possible to change the value of attributes for nodes and edges. To do this we use both the '.' and the equals sign, '=' to "assign" the attribute a new value. For an example of this, lets first make Jack purple, and then make the edge between Jack and Kim orange. Here is the code:

Jack.color = purple
(Jack-Kim).color = orange

Now it is easier to find Jack and the edge between Jack and Kim.



Below is a list of node attributes that you may access, ones that are immutable are marked with an asterisk(*)

Final Example

Here is a final example that will help you put together a couple of the things you have learned.
Let's say we want to investigate what impact the removal of Jack and all of his neighbors would have on the "24" graph. First, make sure you have the "twentyFour.gdf" file loaded and that you have opened the Node Functions Panel. Select Jack and highlight his neighbors. Now shift click Jack and all of his neighbors and click on "Save Group" to save these nodes to a group. Check the image below to make sure you got all of the nodes.

Now save this group under the name "friends". To make it appear like we have removed Jack and his friends, we need to type some commands into the interpreter.

friends.visible = 0

You'll notice something strange about this line of code -- it doesn't contain any node names! In DukeGuess, if you have a group of nodes you can access and change the same attribute for all nodes in the group by using the '.' (dot) operator on the group name the same way you would use it on a node name.
You should end up with a graph that looks something like the one below. Clearly Jack and his friends are a key portion of this social network! Also notice that DukeGuess makes invisible edges attached to invisible nodes