In [1]:
from IPython.display import HTML

HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')
Out[1]:
In [2]:
from IPython.display import Image
Image(filename='out/trajectories1-0.png')
Out[2]:
In [3]:
Image(filename='out/trajectories1-1.png')
Out[3]:

The Python scripts for all the computations displayed here are available at:

https://github.com/mboudour/TrajectoriesOfTemporalGraphs

In [4]:
Image(filename='out/trajectories1-2.png')
Out[4]:
In [5]:
Image(filename='out/trajectories1-3.png')
Out[5]:
In [6]:
Image(filename='out/trajectories1-4.png')
Out[6]:
In [7]:
Image(filename='out/trajectories1-5.png')
Out[7]:
In [8]:
Image(filename='out/trajectories1-6.png')
Out[8]:
In [9]:
Image(filename='out/trajectories1-7.png')
Out[9]:
In [10]:
Image(filename='out/trajectories1-8.png')
Out[10]:
In [11]:
Image(filename='out/trajectories1-9.png')
Out[11]:
In [12]:
Image(filename='out/trajectories1-10.png')
Out[12]:
In [13]:
Image(filename='out/trajectories1-11.png')
Out[13]:
In [14]:
Image(filename='out/trajectories1-12.png')
Out[14]:
In [15]:
Image(filename='out/trajectories1-13.png')
Out[15]:

Trajectory analysis of a random temporal graph

In [16]:
%matplotlib inline
from trajectories import *
k=10
n=8
pp=[0.19,.11,.11,.11,.14,.18,.12,.15,.13,.12]
G,ndls,timetoadd,figi=create_synthetic3lg(k,n,pp)
outfile_namestr,outfile_names,outFig_transit,outfile_name_xls,outfile_name_tex= main_work(G,ndls,timetoadd,figi)
Total number of edges: 27
Number of edges for the time interval (0, 1): 5
Number of edges for the time interval (1, 2): 4
Number of edges for the time interval (2, 3): 1
Number of edges for the time interval (3, 4): 2
Number of edges for the time interval (4, 5): 5
Number of edges for the time interval (5, 6): 4
Number of edges for the time interval (6, 7): 3
Number of edges for the time interval (7, 8): 4
Number of edges for the time interval (8, 9): 3
Number of edges for the time interval (9, 10): 2


Statistics of trajectories

42 trajectories analyzed.
Trajectories of 1: 4
Trajectories of 0: 7
Trajectories of 3: 8
Trajectories of 2: 7
Trajectories of 5: 5
Trajectories of 4: 4
Trajectories of 7: 4
Trajectories of 6: 3

Average length = 3.09523809524
Std. dev. of length = 2.1277

+----------+-------------+--------------+-------------+------------+--------------+----------------+----------------+
| Vertices | fOriginator | fTransmitter | fTerminator | fBlackHole | fInvolvement |  pOriginator   |  pTransmitter  |
+----------+-------------+--------------+-------------+------------+--------------+----------------+----------------+
|    1     |      5      |      3       |      5      |     3      |      10      |      0.5       |      0.3       |
|    0     |      5      |      3       |      5      |     3      |      10      |      0.5       |      0.3       |
|    3     |      4      |      8       |      5      |     1      |      13      | 0.307692307692 | 0.615384615385 |
|    2     |      2      |      11      |      14     |     1      |      15      | 0.133333333333 | 0.733333333333 |
|    5     |      4      |      16      |      2      |     1      |      17      | 0.235294117647 | 0.941176470588 |
|    4     |      6      |      8       |      2      |     0      |      16      |     0.375      |      0.5       |
|    7     |      6      |      6       |      0      |     0      |      12      |      0.5       |      0.5       |
|    6     |      10     |      0       |      9      |     0      |      19      | 0.526315789474 |      0.0       |
+----------+-------------+--------------+-------------+------------+--------------+----------------+----------------+



+----------+----------------+-----------------+---------------+---------------+---------------+------------+
| Vertices |  pTerminator   |    pBlackHole   |  lOriginator  |  lTransmitter |  lTerminator  | lBlackHole |
+----------+----------------+-----------------+---------------+---------------+---------------+------------+
|    1     |      0.5       |       0.3       |      1.4      | 4.33333333333 |      2.0      |    1.0     |
|    0     |      0.5       |       0.3       |      1.4      | 7.33333333333 |      1.4      |    1.0     |
|    3     | 0.384615384615 | 0.0769230769231 |      1.75     |     3.625     |      3.2      |    1.0     |
|    2     | 0.933333333333 | 0.0666666666667 |      2.0      |      7.0      |      5.0      |    1.0     |
|    5     | 0.117647058824 | 0.0588235294118 |      1.75     |     6.375     |      1.5      |    1.0     |
|    4     |     0.125      |       0.0       | 2.66666666667 |     6.875     |      2.0      |     0      |
|    7     |      0.0       |       0.0       | 3.66666666667 |      6.5      |       0       |     0      |
|    6     | 0.473684210526 |       0.0       |      6.0      |       0       | 2.22222222222 |     0      |
+----------+----------------+-----------------+---------------+---------------+---------------+------------+



+----------+---------------+---------------+---------------+-------------+
| Vertices |  lInvolvement |    Position   |  RelPosition  | Betweenness |
+----------+---------------+---------------+---------------+-------------+
|    1     |      2.7      |      2.2      | 40.8333333333 |      7      |
|    0     |      3.3      |      2.1      | 34.2857142857 |      30     |
|    3     | 2.92307692308 |     2.1875    |    45.3125    |      20     |
|    2     | 4.86666666667 | 3.80769230769 | 60.8882783883 |      94     |
|    5     | 4.76470588235 | 2.90476190476 | 40.2267573696 |     108     |
|    4     |     4.6875    |     3.5625    | 53.7351190476 |      39     |
|    7     | 5.08333333333 | 2.83333333333 | 32.1825396825 |      43     |
|    6     | 4.21052631579 | 1.57894736842 | 47.3684210526 |      0      |
+----------+---------------+---------------+---------------+-------------+

Trajectory analysis of a random temporal bipartite graph

In [17]:
k=10
n=8
m=8
pp=[0.08,.082,.081,.081,.074,.081,.072,.075,.083,.08]
G,ndls,timetoadd,figi=create_synthetic3lgB(k,n,m,pp) 
main_work(G,ndls,timetoadd,figi)
#main_work(G,ndls,timetoadd,(figi[1],2,ndls[1]))
Total number of edges: 86
Number of edges in time interval (0, 1): 9
Number of edges in time interval (1, 2): 9
Number of edges in time interval (2, 3): 11
Number of edges in time interval (3, 4): 9
Number of edges in time interval (4, 5): 12
Number of edges in time interval (5, 6): 9
Number of edges in time interval (6, 7): 11
Number of edges in time interval (7, 8): 9
Number of edges in time interval (8, 9): 8
Number of edges in time interval (9, 10): 10


Statistics of trajectories of first mode vertices

188 trajectories analyzed.
Trajectories of B14: 4
Trajectories of B15: 10
Trajectories of B12: 37
Trajectories of B13: 10
Trajectories of B10: 26
Trajectories of B11: 9
Trajectories of B8: 60
Trajectories of B9: 32

Average length = 4.65425531915
Std. dev. of length = 1.9077

+----------+-------------+--------------+-------------+------------+--------------+-----------------+----------------+
| Vertices | fOriginator | fTransmitter | fTerminator | fBlackHole | fInvolvement |   pOriginator   |  pTransmitter  |
+----------+-------------+--------------+-------------+------------+--------------+-----------------+----------------+
|    A1    |      6      |      82      |      10     |     2      |      80      |      0.075      |     1.025      |
|    A0    |      19     |      56      |      19     |     5      |      67      |  0.283582089552 | 0.835820895522 |
|    A3    |      35     |      64      |      4      |     1      |      84      |  0.416666666667 | 0.761904761905 |
|    A2    |      18     |      73      |      67     |     1      |     115      |  0.15652173913  | 0.634782608696 |
|    A5    |      11     |      94      |      16     |     5      |     116      | 0.0948275862069 | 0.810344827586 |
|    A4    |      18     |      36      |      13     |     2      |      65      |  0.276923076923 | 0.553846153846 |
|    A7    |      28     |      46      |      21     |     4      |      83      |  0.33734939759  | 0.55421686747  |
|    A6    |      53     |      60      |      38     |     26     |      77      |  0.688311688312 | 0.779220779221 |
+----------+-------------+--------------+-------------+------------+--------------+-----------------+----------------+



+----------+----------------+------------------+---------------+---------------+---------------+------------+
| Vertices |  pTerminator   |    pBlackHole    |  lOriginator  |  lTransmitter |  lTerminator  | lBlackHole |
+----------+----------------+------------------+---------------+---------------+---------------+------------+
|    A1    |     0.125      |      0.025       | 2.33333333333 | 5.42682926829 |      2.2      |    2.0     |
|    A0    | 0.283582089552 | 0.0746268656716  | 4.26315789474 | 6.42857142857 | 4.73684210526 |    2.0     |
|    A3    | 0.047619047619 | 0.0119047619048  | 4.28571428571 |    5.71875    |      3.0      |    2.0     |
|    A2    | 0.582608695652 | 0.00869565217391 | 3.94444444444 | 5.23287671233 | 5.91044776119 |    2.0     |
|    A5    | 0.137931034483 | 0.0431034482759  | 2.54545454545 | 6.14893617021 |     3.125     |    2.0     |
|    A4    |      0.2       | 0.0307692307692  | 5.22222222222 | 5.08333333333 | 2.30769230769 |    2.0     |
|    A7    | 0.253012048193 | 0.0481927710843  | 5.46428571429 | 6.28260869565 | 4.66666666667 |    2.0     |
|    A6    | 0.493506493506 |  0.337662337662  | 5.35849056604 | 6.86666666667 | 4.65789473684 |    2.0     |
+----------+----------------+------------------+---------------+---------------+---------------+------------+



+----------+---------------+---------------+---------------+-------------+
| Vertices |  lInvolvement |    Position   |  RelPosition  | Betweenness |
+----------+---------------+---------------+---------------+-------------+
|    A1    |     4.8125    | 2.73958333333 | 46.3715277778 |     279     |
|    A0    | 5.46268656716 |  3.8064516129 | 56.4260112647 |     380     |
|    A3    | 4.96428571429 | 2.52941176471 | 33.3333333333 |     316     |
|    A2    |  5.1652173913 | 3.83439490446 | 59.9029420685 |     574     |
|    A5    | 5.56034482759 | 3.10084033613 | 48.4113645458 |     476     |
|    A4    | 4.69230769231 | 2.96923076923 |  55.684981685 |     111     |
|    A7    | 5.66265060241 | 3.66315789474 | 56.9799498747 |     231     |
|    A6    | 5.12987012987 | 2.88513513514 | 39.5431145431 |      48     |
+----------+---------------+---------------+---------------+-------------+


Statistics of trajectories of second mode vertices

36 trajectories analyzed.
Trajectories of A1: 4
Trajectories of A0: 8
Trajectories of A3: 4
Trajectories of A2: 4
Trajectories of A5: 4
Trajectories of A4: 4
Trajectories of A7: 2
Trajectories of A6: 6

Average length = 9.08333333333
Std. dev. of length = 0.7700

+----------+-------------+--------------+-------------+------------+--------------+----------------+---------------+
| Vertices | fOriginator | fTransmitter | fTerminator | fBlackHole | fInvolvement |  pOriginator   |  pTransmitter |
+----------+-------------+--------------+-------------+------------+--------------+----------------+---------------+
|   B14    |      0      |      20      |      4      |     0      |      18      |      0.0       | 1.11111111111 |
|   B15    |      14     |      18      |      3      |     0      |      25      |      0.56      |      0.72     |
|   B12    |      0      |      32      |      4      |     0      |      22      |      0.0       | 1.45454545455 |
|   B13    |      0      |      36      |      6      |     0      |      28      |      0.0       | 1.28571428571 |
|   B10    |      0      |      44      |      0      |     0      |      26      |      0.0       | 1.69230769231 |
|   B11    |      14     |      24      |      12     |     0      |      30      | 0.466666666667 |      0.8      |
|    B8    |      8      |      45      |      2      |     0      |      26      | 0.307692307692 | 1.73076923077 |
|    B9    |      0      |      36      |      5      |     0      |      27      |      0.0       | 1.33333333333 |
+----------+-------------+--------------+-------------+------------+--------------+----------------+---------------+



+----------+-----------------+------------+---------------+---------------+---------------+------------+
| Vertices |   pTerminator   | pBlackHole |  lOriginator  |  lTransmitter |  lTerminator  | lBlackHole |
+----------+-----------------+------------+---------------+---------------+---------------+------------+
|   B14    |  0.222222222222 |    0.0     |       0       |      9.55     |      9.5      |     0      |
|   B15    |       0.12      |    0.0     |      9.5      | 9.27777777778 |      8.0      |     0      |
|   B12    |  0.181818181818 |    0.0     |       0       |    8.65625    |      9.5      |     0      |
|   B13    |  0.214285714286 |    0.0     |       0       | 9.05555555556 | 9.16666666667 |     0      |
|   B10    |       0.0       |    0.0     |       0       | 9.38636363636 |       0       |     0      |
|   B11    |       0.4       |    0.0     | 8.42857142857 |     9.125     |      9.5      |     0      |
|    B8    | 0.0769230769231 |    0.0     |      9.5      |      9.4      |      8.5      |     0      |
|    B9    |  0.185185185185 |    0.0     |       0       | 8.91666666667 |      8.2      |     0      |
+----------+-----------------+------------+---------------+---------------+---------------+------------+



+----------+---------------+---------------+---------------+-------------+
| Vertices |  lInvolvement |    Position   |  RelPosition  | Betweenness |
+----------+---------------+---------------+---------------+-------------+
|   B14    |      9.5      | 5.04166666667 |  47.337962963 |     338     |
|   B15    |      9.24     |      3.6      | 32.7777777778 |     162     |
|   B12    | 8.81818181818 | 5.08333333333 | 53.1360229277 |     443     |
|   B13    |      9.0      | 5.90476190476 | 59.7836356765 |     556     |
|   B10    | 9.23076923077 | 4.72727272727 | 43.9619408369 |     471     |
|   B11    |      9.0      |      5.12     | 49.6428571429 |     386     |
|    B8    | 9.26923076923 | 4.41818181818 | 41.1002886003 |     391     |
|    B9    |      9.0      | 6.68292682927 | 72.3383662408 |     513     |
+----------+---------------+---------------+---------------+-------------+

In [17]: