Counting and Merging Duplicate Edges
If your graph has duplicate edges, you can tell NodeXL to count them, merge them, or both. By default, NodeXL uses the two vertex columns on the Edges worksheet to determine whether two edges are duplicates, but you can specify a third column to use as well.
To count and merge the graph's duplicate edges:
-
In the Excel Ribbon, select NodeXL, Data, Prepare Data, Count and Merge Duplicate Edges.
Here are some things to know about counting and merging duplicate edges:
-
If you tell NodeXL to count duplicate edges, it adds an Edge Weight column to the Edges worksheet if the column isn't already there, then fills in the column. If the worksheet contains these two rows, for example:
Vertex 1 |
Vertex 2 |
John |
Bill |
John |
Bill |
...then the Edge Weight for each of the two rows will be set to 2, because there are two instances of each row:
Vertex 1 |
Vertex 2 |
Edge Weight |
John |
Bill |
2 |
John |
Bill |
2 |
-
If the worksheet already has an Edge Weight column, NodeXL uses any existing edge weights when it counts duplicate edges. If the worksheet contains these two rows, for example:
Vertex 1 |
Vertex 2 |
Edge Weight |
Mary |
Joe |
3 |
Mary |
Joe |
4 |
...then the Edge Weight for each of the two duplicate rows will be set to the sum of their edge weights:
Vertex 1 |
Vertex 2 |
Edge Weight |
Mary |
Joe |
7 |
Mary |
Joe |
7 |
-
NodeXL takes the directedness of the graph into account when it checks for duplicate edges. In a directed graph, a "John,Bill" row and a "Bill,John" row can't be duplicates. In an undirected graph, "John,Bill" and "Bill,John" can be duplicates.
-
If you specify a third column to use on the Edges worksheet, two edges have to have the same values in that column before they can be considered duplicates. For example, if you specify the Relationship column when counting duplicate edges in this worksheet:
Vertex 1 |
Vertex 2 |
Relationship |
Dave |
Joe |
Mentions |
Dave |
Joe |
Follows |
Dave |
Joe |
Mentions |
...then the results will look like this:
Vertex 1 |
Vertex 2 |
Relationship |
Edge Weight |
Dave |
Joe |
Mentions |
2 |
Dave |
Joe |
Follows |
1 |
Dave |
Joe |
Mentions |
2 |
-
If you tell NodeXL to merge the duplicate edges, all but the first edge in each set of duplicates is deleted from the Edges worksheet. For example, merging duplicate edges in this worksheet:
Vertex 1 |
Vertex 2 |
Color |
Jack |
Jill |
Blue |
Sally |
Ralph |
Orange |
Jack |
Jill |
Green |
Sally |
Ralph |
Orange |
...results in this:
Vertex 1 |
Vertex 2 |
Color |
Jack |
Jill |
Blue |
Sally |
Ralph |
Orange |
Note that the edge attributes for the first edge in a set of duplicate edges become the edge attributes for the merged edge. Thus, the two "Jack,Jill" edges get merged into a Blue edge, even though the original edges had different colors. The Green color of the second edge is lost, along with any other attributes the second edge had.
-
NodeXL automatically counts and merges duplicate edges when you export the graph. A third column cannot be specified during an export. If you want more control over how duplicate edges are handled, use Count and Merge Duplicate Edges before exporting the graph.