(self, source, target, ts)
Adds a directed time-stamped edge (source,target;time) to the temporal network. To add an undirected 
            time-stamped link (u,v;t) at time t, please call addEdge(u,v;t) and addEdge(v,u;t).
        
        @param source: name of the source node of a directed, time-stamped link
        @param target: name of the target node of a directed, time-stamped link
        @param ts: (integer) time-stamp of the time-stamped link
Adds a directed time-stamped edge (source,target;time) to the temporal network. To add an undirected 
            time-stamped link (u,v;t) at time t, please call addEdge(u,v;t) and addEdge(v,u;t).
Adds a directed time - stamped edge ( source target ; time ) to the temporal network . To add an undirected time - stamped link ( u v ; t ) at time t please call addEdge ( u v ; t ) and addEdge ( v u ; t ) .
def addEdge(self, source, target, ts):
        """Adds a directed time-stamped edge (source,target;time) to the temporal network. To add an undirected 
            time-stamped link (u,v;t) at time t, please call addEdge(u,v;t) and addEdge(v,u;t).
        
        @param source: name of the source node of a directed, time-stamped link
        @param target: name of the target node of a directed, time-stamped link
        @param ts: (integer) time-stamp of the time-stamped link
        """
        e = (source, target, ts)
        self.tedges.append(e)
        if source not in self.nodes:
            self.nodes.append(source)
        if target not in self.nodes:
            self.nodes.append(target)

        # Add edge to index structures
        self.time[ts].append(e)
        self.targets[ts].setdefault(target, []).append(e)
        self.sources[ts].setdefault(source, []).append(e)

        if ts not in self.activities[source]:
            self.activities[source].append(ts)
            self.activities[source].sort()

        # Reorder time stamps
        self.ordered_times = sorted(self.time.keys())
def addEdge ( self , source , target , ts ) : e = ( source , target , ts ) self . tedges . append ( e ) if source not in self . nodes : self . nodes . append ( source ) if target not in self . nodes : self . nodes . append ( target ) # Add edge to index structures self . time [ ts ] . append ( e ) self . targets [ ts ] . setdefault ( target , [ ] ) . append ( e ) self . sources [ ts ] . setdefault ( source , [ ] ) . append ( e ) if ts not in self . activities [ source ] : self . activities [ source ] . append ( ts ) self . activities [ source ] . sort ( ) # Reorder time stamps self . ordered_times = sorted ( self . time . keys ( ) )