### Synopsis

Differences or similarities in networks are typically discovered in a side-by-side comparison.

We can simplify this process by visualizing the differences or similarities between two hive plots as a differential hive plot.

### Set Operations

Differential hive plots can be constructed by performing a set operation on two given hive plots "A" and "B":

Operation | Denotation | Effect |
---|---|---|

intersection | A ∩ B | Select similar nodes and edges from "A" and "B". |

relative complement | A ∖ B | Select nodes and edges from "A" that are not found in "B". |

symmetric difference | A Δ B | Select unique nodes and edges from each plot. |

union | A ∪ B | Select all nodes and edges from "A" and "B". Equivalent to joining the results of intersection and symmetric difference. |

Here are 4 different differential hive plots:

### Definition of Similarness

Two edges are *similar* if all of the following are met:

- sources are on the same axis
- sinks are on the same axis
- directionality must agree for directed edges only
- positions of the sources are within the margin of error
- positions of the sinks are within the margin of error
- sources have the same name (optional)
- sinks have the same name (optional)

### Margin of Error

The margin of error defines the degree of similarness. There are 2 types of error:

Type | Definition |
---|---|

Absolute Error | The difference in the original values used to define the node's position on the hive plot. Domain: same as the parameter chosen for node position assignment |

Relative Error | The difference in the node's relative position on the axis. Domain: (0,1) |

### Attributes for Format Rules

Every node or edge in a differential hive plot is assigned a value for the ** src** attribute:

Value | Definition |
---|---|

`A` | This item is unique to hive plot "A". |

`B` | This item is unique to hive plot "B". |

`AB` | This item is common to both hive plots "A" and "B". |

In the 4 examples above, format rules were applied to assign colors based on the `src`

attribute.

Nodes that are not *similar* are assigned a value for the ** diff** attribute:

Value | Definition |
---|---|

`onaxis` | Nodes are on the same axis but no within the margin of error. |

`offaxis` | Nodes are on different axis. |

`offplot` | The node is not found in the other hive plot. |