Handling of ambiguous updates
Because Raphtory allows updates to be ingested in any order from multiple sources, we have to handle various corner cases once deletions are available. The following sections cover the most common scenarios.
Order of resolving additions and deletions
Here two edges between Alice and Bob overlap in time: one starting at time 1 and ending at time 5, another starting at time 3 and ending at time 7.
Event graphs in Raphtory allow edges between the same pair of nodes to happen at the same instant. However, when we look at the exploded edges of this PersistentGraph, the following is returned:
Two edges are created, one that exists from time 1 to time 3 and another that exists from time 3 to time 5. The second deletion at time 7 is ignored.
The reason for this is that Raphtory's graph updates are inserted in chronological order, so that the same graph is constructed regardless of the order in which the updates are made. With an exception for events which have the same timestamp, which will be covered shortly.
Hanging deletions
Adding edges without a deletion afterwards results in an edge which lasts forever, while deleting an edge without a prior addition does not effect the history. However, hanging deletions are tracked as an object and if the history is later modified to add the corresponding edge at an earlier time the delete will become valid and occur as expected.
Additions and deletions in the same instant
If the update times to an edge are all distinct from each other, the graph that is constructed is fully unambiguous. When events have the same timestamp, Raphtory tie-breaks the updates by the order in which they are executed.
The execution order determines the final state: when we add then delete, the edge appears and disappears instantly. When we delete then add, the edge exists from that point onwards.
Interaction with layers
Layering allows different types of interaction to exist, and edges on different layers can have overlapping times in a way that doesn't make sense for edges in the same layer or for edges with no layer.
Consider an example without layers:
Now take a look at a slightly modified example with layers:
By adding layer names to the different edge instances we produce a different result.
Here we have two edges, one starting and ending at 1 and 5 respectively with the 'colleague' layer, the other starting and ending at 3 and 7 on the 'friends' layer.