Revision f9e3a1f0

View differences:

custompackages/graph-parser/Makefile
54 54
define Build/Prepare
55 55
	mkdir -p $(PKG_BUILD_DIR)
56 56
	$(CP) ./src/* $(PKG_BUILD_DIR)/
57
	mkdir -p $(PKG_BUILD_DIR)/input
58
	$(CP) ./input/* $(PKG_BUILD_DIR)/input/
57 59
endef
58 60

  
59 61

  
......
71 73
define Package/graph-parser/install
72 74
	$(INSTALL_DIR) $(1)/bin
73 75
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/graph-parser $(1)/bin/
76
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/input/simple.edges $(1)/bin/
74 77
endef
75 78

  
76 79

  
custompackages/graph-parser/input/ninux_unweighted_connected.edges
1
1   9   1
2
0   43  1
3
4   16  1
4
6   7   1
5
19  93  1
6
5   52  1
7
4   43  1
8
7   75  1
9
1   64  1
10
1   8   1
11
1   82  1
12
1   21  1
13
1   104 1
14
1   41  1
15
1   112 1
16
1   117 1
17
1   59  1
18
1   124 1
19
1   62  1
20
2   122 1
21
3   26  1
22
3   90  1
23
4   4   1
24
4   44  1
25
4   52  1
26
4   53  1
27
4   90  1
28
4   10  1
29
6   6   1
30
6   103 1
31
6   46  1
32
6   40  1
33
6   114 1
34
6   121 1
35
7   111 1
36
7   63  1
37
8   22  1
38
9   102 1
39
10  17  1
40
10  70  1
41
11  39  1
42
12  113 1
43
13  43  1
44
14  105 1
45
14  118 1
46
15  35  1
47
15  86  1
48
16  39  1
49
16  78  1
50
16  57  1
51
16  118 1
52
16  20  1
53
16  88  1
54
16  61  1
55
17  43  1
56
17  45  1
57
18  113 1
58
18  58  1
59
19  79  1
60
19  48  1
61
19  84  1
62
19  94  1
63
19  55  1
64
19  116 1
65
21  22  1
66
22  124 1
67
23  72  1
68
24  90  1
69
25  39  1
70
26  70  1
71
26  72  1
72
26  89  1
73
27  44  1
74
28  87  1
75
29  49  1
76
30  118 1
77
31  38  1
78
31  47  1
79
32  45  1
80
32  95  1
81
33  109 1
82
34  45  1
83
34  86  1
84
35  122 1
85
35  69  1
86
36  43  1
87
37  97  1
88
37  66  1
89
37  68  1
90
37  107 1
91
37  54  1
92
38  48  1
93
38  77  1
94
39  112 1
95
39  103 1
96
39  89  1
97
39  87  1
98
42  45  1
99
43  102 1
100
43  70  1
101
43  50  1
102
44  74  1
103
44  71  1
104
44  108 1
105
44  120 1
106
44  92  1
107
45  115 1
108
46  106 1
109
48  120 1
110
49  113 1
111
51  89  1
112
52  109 1
113
55  122 1
114
56  109 1
115
57  114 1
116
57  72  1
117
60  109 1
118
60  86  1
119
65  97  1
120
67  98  1
121
71  87  1
122
72  84  1
123
73  84  1
124
76  97  1
125
77  99  1
126
79  99  1
127
80  97  1
128
81  87  1
129
83  92  1
130
85  97  1
131
86  100 1
132
86  97  1
133
91  92  1
134
92  96  1
135
93  113 1
136
94  99  1
137
97  98  1
138
97  99  1
139
97  109 1
140
98  102 1
141
101 112 1
142
110 116 1
143
112 125 1
144
119 122 1
145
120 120 1
146
122 123 1
custompackages/graph-parser/output/visualization/jsoninfo_topo_weighted.eps
1
%!PS-Adobe-2.0 EPSF-2.0
2
%%Title: ../output/visualization/jsoninfo_topo_weighted.eps
3
%%Creator: gnuplot 4.6 patchlevel 4
4
%%CreationDate: Wed Feb 17 14:22:05 2016
5
%%DocumentFonts: (atend)
6
%%BoundingBox: 50 50 410 302
7
%%EndComments
8
%%BeginProlog
9
/gnudict 256 dict def
10
gnudict begin
11
%
12
% The following true/false flags may be edited by hand if desired.
13
% The unit line width and grayscale image gamma correction may also be changed.
14
%
15
/Color true def
16
/Blacktext false def
17
/Solid false def
18
/Dashlength 1 def
19
/Landscape false def
20
/Level1 false def
21
/Rounded false def
22
/ClipToBoundingBox false def
23
/SuppressPDFMark false def
24
/TransparentPatterns false def
25
/gnulinewidth 5.000 def
26
/userlinewidth gnulinewidth def
27
/Gamma 1.0 def
28
/BackgroundColor {-1.000 -1.000 -1.000} def
29
%
30
/vshift -46 def
31
/dl1 {
32
  10.0 Dashlength mul mul
33
  Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
34
} def
35
/dl2 {
36
  10.0 Dashlength mul mul
37
  Rounded { currentlinewidth 0.75 mul add } if
38
} def
39
/hpt_ 31.5 def
40
/vpt_ 31.5 def
41
/hpt hpt_ def
42
/vpt vpt_ def
43
/doclip {
44
  ClipToBoundingBox {
45
    newpath 50 50 moveto 410 50 lineto 410 302 lineto 50 302 lineto closepath
46
    clip
47
  } if
48
} def
49
%
50
% Gnuplot Prolog Version 4.6 (September 2012)
51
%
52
%/SuppressPDFMark true def
53
%
54
/M {moveto} bind def
55
/L {lineto} bind def
56
/R {rmoveto} bind def
57
/V {rlineto} bind def
58
/N {newpath moveto} bind def
59
/Z {closepath} bind def
60
/C {setrgbcolor} bind def
61
/f {rlineto fill} bind def
62
/g {setgray} bind def
63
/Gshow {show} def   % May be redefined later in the file to support UTF-8
64
/vpt2 vpt 2 mul def
65
/hpt2 hpt 2 mul def
66
/Lshow {currentpoint stroke M 0 vshift R 
67
	Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
68
/Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
69
	Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
70
/Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R 
71
	Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
72
/UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
73
  /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
74
/DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
75
 {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse} def
76
/BL {stroke userlinewidth 2 mul setlinewidth
77
	Rounded {1 setlinejoin 1 setlinecap} if} def
78
/AL {stroke userlinewidth 2 div setlinewidth
79
	Rounded {1 setlinejoin 1 setlinecap} if} def
80
/UL {dup gnulinewidth mul /userlinewidth exch def
81
	dup 1 lt {pop 1} if 10 mul /udl exch def} def
82
/PL {stroke userlinewidth setlinewidth
83
	Rounded {1 setlinejoin 1 setlinecap} if} def
84
3.8 setmiterlimit
85
% Default Line colors
86
/LCw {1 1 1} def
87
/LCb {0 0 0} def
88
/LCa {0 0 0} def
89
/LC0 {1 0 0} def
90
/LC1 {0 1 0} def
91
/LC2 {0 0 1} def
92
/LC3 {1 0 1} def
93
/LC4 {0 1 1} def
94
/LC5 {1 1 0} def
95
/LC6 {0 0 0} def
96
/LC7 {1 0.3 0} def
97
/LC8 {0.5 0.5 0.5} def
98
% Default Line Types
99
/LTw {PL [] 1 setgray} def
100
/LTb {BL [] LCb DL} def
101
/LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
102
/LT0 {PL [] LC0 DL} def
103
/LT1 {PL [4 dl1 2 dl2] LC1 DL} def
104
/LT2 {PL [2 dl1 3 dl2] LC2 DL} def
105
/LT3 {PL [1 dl1 1.5 dl2] LC3 DL} def
106
/LT4 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
107
/LT5 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC5 DL} def
108
/LT6 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC6 DL} def
109
/LT7 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC7 DL} def
110
/LT8 {PL [2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 4 dl2] LC8 DL} def
111
/Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
112
/Dia {stroke [] 0 setdash 2 copy vpt add M
113
  hpt neg vpt neg V hpt vpt neg V
114
  hpt vpt V hpt neg vpt V closepath stroke
115
  Pnt} def
116
/Pls {stroke [] 0 setdash vpt sub M 0 vpt2 V
117
  currentpoint stroke M
118
  hpt neg vpt neg R hpt2 0 V stroke
119
 } def
120
/Box {stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M
121
  0 vpt2 neg V hpt2 0 V 0 vpt2 V
122
  hpt2 neg 0 V closepath stroke
123
  Pnt} def
124
/Crs {stroke [] 0 setdash exch hpt sub exch vpt add M
125
  hpt2 vpt2 neg V currentpoint stroke M
126
  hpt2 neg 0 R hpt2 vpt2 V stroke} def
127
/TriU {stroke [] 0 setdash 2 copy vpt 1.12 mul add M
128
  hpt neg vpt -1.62 mul V
129
  hpt 2 mul 0 V
130
  hpt neg vpt 1.62 mul V closepath stroke
131
  Pnt} def
132
/Star {2 copy Pls Crs} def
133
/BoxF {stroke [] 0 setdash exch hpt sub exch vpt add M
134
  0 vpt2 neg V hpt2 0 V 0 vpt2 V
135
  hpt2 neg 0 V closepath fill} def
136
/TriUF {stroke [] 0 setdash vpt 1.12 mul add M
137
  hpt neg vpt -1.62 mul V
138
  hpt 2 mul 0 V
139
  hpt neg vpt 1.62 mul V closepath fill} def
140
/TriD {stroke [] 0 setdash 2 copy vpt 1.12 mul sub M
141
  hpt neg vpt 1.62 mul V
142
  hpt 2 mul 0 V
143
  hpt neg vpt -1.62 mul V closepath stroke
144
  Pnt} def
145
/TriDF {stroke [] 0 setdash vpt 1.12 mul sub M
146
  hpt neg vpt 1.62 mul V
147
  hpt 2 mul 0 V
148
  hpt neg vpt -1.62 mul V closepath fill} def
149
/DiaF {stroke [] 0 setdash vpt add M
150
  hpt neg vpt neg V hpt vpt neg V
151
  hpt vpt V hpt neg vpt V closepath fill} def
152
/Pent {stroke [] 0 setdash 2 copy gsave
153
  translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
154
  closepath stroke grestore Pnt} def
155
/PentF {stroke [] 0 setdash gsave
156
  translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
157
  closepath fill grestore} def
158
/Circle {stroke [] 0 setdash 2 copy
159
  hpt 0 360 arc stroke Pnt} def
160
/CircleF {stroke [] 0 setdash hpt 0 360 arc fill} def
161
/C0 {BL [] 0 setdash 2 copy moveto vpt 90 450 arc} bind def
162
/C1 {BL [] 0 setdash 2 copy moveto
163
	2 copy vpt 0 90 arc closepath fill
164
	vpt 0 360 arc closepath} bind def
165
/C2 {BL [] 0 setdash 2 copy moveto
166
	2 copy vpt 90 180 arc closepath fill
167
	vpt 0 360 arc closepath} bind def
168
/C3 {BL [] 0 setdash 2 copy moveto
169
	2 copy vpt 0 180 arc closepath fill
170
	vpt 0 360 arc closepath} bind def
171
/C4 {BL [] 0 setdash 2 copy moveto
172
	2 copy vpt 180 270 arc closepath fill
173
	vpt 0 360 arc closepath} bind def
174
/C5 {BL [] 0 setdash 2 copy moveto
175
	2 copy vpt 0 90 arc
176
	2 copy moveto
177
	2 copy vpt 180 270 arc closepath fill
178
	vpt 0 360 arc} bind def
179
/C6 {BL [] 0 setdash 2 copy moveto
180
	2 copy vpt 90 270 arc closepath fill
181
	vpt 0 360 arc closepath} bind def
182
/C7 {BL [] 0 setdash 2 copy moveto
183
	2 copy vpt 0 270 arc closepath fill
184
	vpt 0 360 arc closepath} bind def
185
/C8 {BL [] 0 setdash 2 copy moveto
186
	2 copy vpt 270 360 arc closepath fill
187
	vpt 0 360 arc closepath} bind def
188
/C9 {BL [] 0 setdash 2 copy moveto
189
	2 copy vpt 270 450 arc closepath fill
190
	vpt 0 360 arc closepath} bind def
191
/C10 {BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill
192
	2 copy moveto
193
	2 copy vpt 90 180 arc closepath fill
194
	vpt 0 360 arc closepath} bind def
195
/C11 {BL [] 0 setdash 2 copy moveto
196
	2 copy vpt 0 180 arc closepath fill
197
	2 copy moveto
198
	2 copy vpt 270 360 arc closepath fill
199
	vpt 0 360 arc closepath} bind def
200
/C12 {BL [] 0 setdash 2 copy moveto
201
	2 copy vpt 180 360 arc closepath fill
202
	vpt 0 360 arc closepath} bind def
203
/C13 {BL [] 0 setdash 2 copy moveto
204
	2 copy vpt 0 90 arc closepath fill
205
	2 copy moveto
206
	2 copy vpt 180 360 arc closepath fill
207
	vpt 0 360 arc closepath} bind def
208
/C14 {BL [] 0 setdash 2 copy moveto
209
	2 copy vpt 90 360 arc closepath fill
210
	vpt 0 360 arc} bind def
211
/C15 {BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill
212
	vpt 0 360 arc closepath} bind def
213
/Rec {newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
214
	neg 0 rlineto closepath} bind def
215
/Square {dup Rec} bind def
216
/Bsquare {vpt sub exch vpt sub exch vpt2 Square} bind def
217
/S0 {BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare} bind def
218
/S1 {BL [] 0 setdash 2 copy vpt Square fill Bsquare} bind def
219
/S2 {BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
220
/S3 {BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare} bind def
221
/S4 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
222
/S5 {BL [] 0 setdash 2 copy 2 copy vpt Square fill
223
	exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
224
/S6 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare} bind def
225
/S7 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill
226
	2 copy vpt Square fill Bsquare} bind def
227
/S8 {BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare} bind def
228
/S9 {BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare} bind def
229
/S10 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill
230
	Bsquare} bind def
231
/S11 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill
232
	Bsquare} bind def
233
/S12 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare} bind def
234
/S13 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
235
	2 copy vpt Square fill Bsquare} bind def
236
/S14 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
237
	2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
238
/S15 {BL [] 0 setdash 2 copy Bsquare fill Bsquare} bind def
239
/D0 {gsave translate 45 rotate 0 0 S0 stroke grestore} bind def
240
/D1 {gsave translate 45 rotate 0 0 S1 stroke grestore} bind def
241
/D2 {gsave translate 45 rotate 0 0 S2 stroke grestore} bind def
242
/D3 {gsave translate 45 rotate 0 0 S3 stroke grestore} bind def
243
/D4 {gsave translate 45 rotate 0 0 S4 stroke grestore} bind def
244
/D5 {gsave translate 45 rotate 0 0 S5 stroke grestore} bind def
245
/D6 {gsave translate 45 rotate 0 0 S6 stroke grestore} bind def
246
/D7 {gsave translate 45 rotate 0 0 S7 stroke grestore} bind def
247
/D8 {gsave translate 45 rotate 0 0 S8 stroke grestore} bind def
248
/D9 {gsave translate 45 rotate 0 0 S9 stroke grestore} bind def
249
/D10 {gsave translate 45 rotate 0 0 S10 stroke grestore} bind def
250
/D11 {gsave translate 45 rotate 0 0 S11 stroke grestore} bind def
251
/D12 {gsave translate 45 rotate 0 0 S12 stroke grestore} bind def
252
/D13 {gsave translate 45 rotate 0 0 S13 stroke grestore} bind def
253
/D14 {gsave translate 45 rotate 0 0 S14 stroke grestore} bind def
254
/D15 {gsave translate 45 rotate 0 0 S15 stroke grestore} bind def
255
/DiaE {stroke [] 0 setdash vpt add M
256
  hpt neg vpt neg V hpt vpt neg V
257
  hpt vpt V hpt neg vpt V closepath stroke} def
258
/BoxE {stroke [] 0 setdash exch hpt sub exch vpt add M
259
  0 vpt2 neg V hpt2 0 V 0 vpt2 V
260
  hpt2 neg 0 V closepath stroke} def
261
/TriUE {stroke [] 0 setdash vpt 1.12 mul add M
262
  hpt neg vpt -1.62 mul V
263
  hpt 2 mul 0 V
264
  hpt neg vpt 1.62 mul V closepath stroke} def
265
/TriDE {stroke [] 0 setdash vpt 1.12 mul sub M
266
  hpt neg vpt 1.62 mul V
267
  hpt 2 mul 0 V
268
  hpt neg vpt -1.62 mul V closepath stroke} def
269
/PentE {stroke [] 0 setdash gsave
270
  translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
271
  closepath stroke grestore} def
272
/CircE {stroke [] 0 setdash 
273
  hpt 0 360 arc stroke} def
274
/Opaque {gsave closepath 1 setgray fill grestore 0 setgray closepath} def
275
/DiaW {stroke [] 0 setdash vpt add M
276
  hpt neg vpt neg V hpt vpt neg V
277
  hpt vpt V hpt neg vpt V Opaque stroke} def
278
/BoxW {stroke [] 0 setdash exch hpt sub exch vpt add M
279
  0 vpt2 neg V hpt2 0 V 0 vpt2 V
280
  hpt2 neg 0 V Opaque stroke} def
281
/TriUW {stroke [] 0 setdash vpt 1.12 mul add M
282
  hpt neg vpt -1.62 mul V
283
  hpt 2 mul 0 V
284
  hpt neg vpt 1.62 mul V Opaque stroke} def
285
/TriDW {stroke [] 0 setdash vpt 1.12 mul sub M
286
  hpt neg vpt 1.62 mul V
287
  hpt 2 mul 0 V
288
  hpt neg vpt -1.62 mul V Opaque stroke} def
289
/PentW {stroke [] 0 setdash gsave
290
  translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
291
  Opaque stroke grestore} def
292
/CircW {stroke [] 0 setdash 
293
  hpt 0 360 arc Opaque stroke} def
294
/BoxFill {gsave Rec 1 setgray fill grestore} def
295
/Density {
296
  /Fillden exch def
297
  currentrgbcolor
298
  /ColB exch def /ColG exch def /ColR exch def
299
  /ColR ColR Fillden mul Fillden sub 1 add def
300
  /ColG ColG Fillden mul Fillden sub 1 add def
301
  /ColB ColB Fillden mul Fillden sub 1 add def
302
  ColR ColG ColB setrgbcolor} def
303
/BoxColFill {gsave Rec PolyFill} def
304
/PolyFill {gsave Density fill grestore grestore} def
305
/h {rlineto rlineto rlineto gsave closepath fill grestore} bind def
306
%
307
% PostScript Level 1 Pattern Fill routine for rectangles
308
% Usage: x y w h s a XX PatternFill
309
%	x,y = lower left corner of box to be filled
310
%	w,h = width and height of box
311
%	  a = angle in degrees between lines and x-axis
312
%	 XX = 0/1 for no/yes cross-hatch
313
%
314
/PatternFill {gsave /PFa [ 9 2 roll ] def
315
  PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate
316
  PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec
317
  TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
318
  clip
319
  currentlinewidth 0.5 mul setlinewidth
320
  /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def
321
  0 0 M PFa 5 get rotate PFs -2 div dup translate
322
  0 1 PFs PFa 4 get div 1 add floor cvi
323
	{PFa 4 get mul 0 M 0 PFs V} for
324
  0 PFa 6 get ne {
325
	0 1 PFs PFa 4 get div 1 add floor cvi
326
	{PFa 4 get mul 0 2 1 roll M PFs 0 V} for
327
 } if
328
  stroke grestore} def
329
%
330
/languagelevel where
331
 {pop languagelevel} {1} ifelse
332
 2 lt
333
	{/InterpretLevel1 true def}
334
	{/InterpretLevel1 Level1 def}
335
 ifelse
336
%
337
% PostScript level 2 pattern fill definitions
338
%
339
/Level2PatternFill {
340
/Tile8x8 {/PaintType 2 /PatternType 1 /TilingType 1 /BBox [0 0 8 8] /XStep 8 /YStep 8}
341
	bind def
342
/KeepColor {currentrgbcolor [/Pattern /DeviceRGB] setcolorspace} bind def
343
<< Tile8x8
344
 /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke} 
345
>> matrix makepattern
346
/Pat1 exch def
347
<< Tile8x8
348
 /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke
349
	0 4 M 4 8 L 8 4 L 4 0 L 0 4 L stroke}
350
>> matrix makepattern
351
/Pat2 exch def
352
<< Tile8x8
353
 /PaintProc {0.5 setlinewidth pop 0 0 M 0 8 L
354
	8 8 L 8 0 L 0 0 L fill}
355
>> matrix makepattern
356
/Pat3 exch def
357
<< Tile8x8
358
 /PaintProc {0.5 setlinewidth pop -4 8 M 8 -4 L
359
	0 12 M 12 0 L stroke}
360
>> matrix makepattern
361
/Pat4 exch def
362
<< Tile8x8
363
 /PaintProc {0.5 setlinewidth pop -4 0 M 8 12 L
364
	0 -4 M 12 8 L stroke}
365
>> matrix makepattern
366
/Pat5 exch def
367
<< Tile8x8
368
 /PaintProc {0.5 setlinewidth pop -2 8 M 4 -4 L
369
	0 12 M 8 -4 L 4 12 M 10 0 L stroke}
370
>> matrix makepattern
371
/Pat6 exch def
372
<< Tile8x8
373
 /PaintProc {0.5 setlinewidth pop -2 0 M 4 12 L
374
	0 -4 M 8 12 L 4 -4 M 10 8 L stroke}
375
>> matrix makepattern
376
/Pat7 exch def
377
<< Tile8x8
378
 /PaintProc {0.5 setlinewidth pop 8 -2 M -4 4 L
379
	12 0 M -4 8 L 12 4 M 0 10 L stroke}
380
>> matrix makepattern
381
/Pat8 exch def
382
<< Tile8x8
383
 /PaintProc {0.5 setlinewidth pop 0 -2 M 12 4 L
384
	-4 0 M 12 8 L -4 4 M 8 10 L stroke}
385
>> matrix makepattern
386
/Pat9 exch def
387
/Pattern1 {PatternBgnd KeepColor Pat1 setpattern} bind def
388
/Pattern2 {PatternBgnd KeepColor Pat2 setpattern} bind def
389
/Pattern3 {PatternBgnd KeepColor Pat3 setpattern} bind def
390
/Pattern4 {PatternBgnd KeepColor Landscape {Pat5} {Pat4} ifelse setpattern} bind def
391
/Pattern5 {PatternBgnd KeepColor Landscape {Pat4} {Pat5} ifelse setpattern} bind def
392
/Pattern6 {PatternBgnd KeepColor Landscape {Pat9} {Pat6} ifelse setpattern} bind def
393
/Pattern7 {PatternBgnd KeepColor Landscape {Pat8} {Pat7} ifelse setpattern} bind def
394
} def
395
%
396
%
397
%End of PostScript Level 2 code
398
%
399
/PatternBgnd {
400
  TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
401
} def
402
%
403
% Substitute for Level 2 pattern fill codes with
404
% grayscale if Level 2 support is not selected.
405
%
406
/Level1PatternFill {
407
/Pattern1 {0.250 Density} bind def
408
/Pattern2 {0.500 Density} bind def
409
/Pattern3 {0.750 Density} bind def
410
/Pattern4 {0.125 Density} bind def
411
/Pattern5 {0.375 Density} bind def
412
/Pattern6 {0.625 Density} bind def
413
/Pattern7 {0.875 Density} bind def
414
} def
415
%
416
% Now test for support of Level 2 code
417
%
418
Level1 {Level1PatternFill} {Level2PatternFill} ifelse
419
%
420
/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
421
dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
422
currentdict end definefont pop
423
/MFshow {
424
   { dup 5 get 3 ge
425
     { 5 get 3 eq {gsave} {grestore} ifelse }
426
     {dup dup 0 get findfont exch 1 get scalefont setfont
427
     [ currentpoint ] exch dup 2 get 0 exch R dup 5 get 2 ne {dup dup 6
428
     get exch 4 get {Gshow} {stringwidth pop 0 R} ifelse }if dup 5 get 0 eq
429
     {dup 3 get {2 get neg 0 exch R pop} {pop aload pop M} ifelse} {dup 5
430
     get 1 eq {dup 2 get exch dup 3 get exch 6 get stringwidth pop -2 div
431
     dup 0 R} {dup 6 get stringwidth pop -2 div 0 R 6 get
432
     show 2 index {aload pop M neg 3 -1 roll neg R pop pop} {pop pop pop
433
     pop aload pop M} ifelse }ifelse }ifelse }
434
     ifelse }
435
   forall} def
436
/Gswidth {dup type /stringtype eq {stringwidth} {pop (n) stringwidth} ifelse} def
437
/MFwidth {0 exch { dup 5 get 3 ge { 5 get 3 eq { 0 } { pop } ifelse }
438
 {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont
439
     6 get Gswidth pop add} {pop} ifelse} ifelse} forall} def
440
/MLshow { currentpoint stroke M
441
  0 exch R
442
  Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
443
/MRshow { currentpoint stroke M
444
  exch dup MFwidth neg 3 -1 roll R
445
  Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
446
/MCshow { currentpoint stroke M
447
  exch dup MFwidth -2 div 3 -1 roll R
448
  Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
449
/XYsave    { [( ) 1 2 true false 3 ()] } bind def
450
/XYrestore { [( ) 1 2 true false 4 ()] } bind def
451
Level1 SuppressPDFMark or 
452
{} {
453
/SDict 10 dict def
454
systemdict /pdfmark known not {
455
  userdict /pdfmark systemdict /cleartomark get put
456
} if
457
SDict begin [
458
  /Title (../output/visualization/jsoninfo_topo_weighted.eps)
459
  /Subject (gnuplot plot)
460
  /Creator (gnuplot 4.6 patchlevel 4)
461
  /Author (quynh)
462
%  /Producer (gnuplot)
463
%  /Keywords ()
464
  /CreationDate (Wed Feb 17 14:22:05 2016)
465
  /DOCINFO pdfmark
466
end
467
} ifelse
468
end
469
%%EndProlog
470
%%Page: 1 1
471
gnudict begin
472
gsave
473
doclip
474
50 50 translate
475
0.050 0.050 scale
476
0 setgray
477
newpath
478
(Helvetica) findfont 140 scalefont setfont
479
BackgroundColor 0 lt 3 1 roll 0 lt exch 0 lt or or not {BackgroundColor C 1.000 0 0 7200.00 5040.00 BoxColFill} if
480
1.000 UL
481
LTb
482
LCb setrgbcolor
483
686 448 M
484
63 0 V
485
6198 0 R
486
-63 0 V
487
stroke
488
602 448 M
489
[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
490
] -46.7 MRshow
491
1.000 UL
492
LTb
493
LCb setrgbcolor
494
686 1044 M
495
63 0 V
496
6198 0 R
497
-63 0 V
498
stroke
499
602 1044 M
500
[ [(Helvetica) 140.0 0.0 true true 0 ( 0.1)]
501
] -46.7 MRshow
502
1.000 UL
503
LTb
504
LCb setrgbcolor
505
686 1640 M
506
63 0 V
507
6198 0 R
508
-63 0 V
509
stroke
510
602 1640 M
511
[ [(Helvetica) 140.0 0.0 true true 0 ( 0.2)]
512
] -46.7 MRshow
513
1.000 UL
514
LTb
515
LCb setrgbcolor
516
686 2236 M
517
63 0 V
518
6198 0 R
519
-63 0 V
520
stroke
521
602 2236 M
522
[ [(Helvetica) 140.0 0.0 true true 0 ( 0.3)]
523
] -46.7 MRshow
524
1.000 UL
525
LTb
526
LCb setrgbcolor
527
686 2831 M
528
63 0 V
529
6198 0 R
530
-63 0 V
531
stroke
532
602 2831 M
533
[ [(Helvetica) 140.0 0.0 true true 0 ( 0.4)]
534
] -46.7 MRshow
535
1.000 UL
536
LTb
537
LCb setrgbcolor
538
686 3427 M
539
63 0 V
540
6198 0 R
541
-63 0 V
542
stroke
543
602 3427 M
544
[ [(Helvetica) 140.0 0.0 true true 0 ( 0.5)]
545
] -46.7 MRshow
546
1.000 UL
547
LTb
548
LCb setrgbcolor
549
686 4023 M
550
63 0 V
551
6198 0 R
552
-63 0 V
553
stroke
554
602 4023 M
555
[ [(Helvetica) 140.0 0.0 true true 0 ( 0.6)]
556
] -46.7 MRshow
557
1.000 UL
558
LTb
559
LCb setrgbcolor
560
686 4619 M
561
63 0 V
562
6198 0 R
563
-63 0 V
564
stroke
565
602 4619 M
566
[ [(Helvetica) 140.0 0.0 true true 0 ( 0.7)]
567
] -46.7 MRshow
568
1.000 UL
569
LTb
570
LCb setrgbcolor
571
686 448 M
572
0 63 V
573
0 4108 R
574
0 -63 V
575
stroke
576
686 308 M
577
[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
578
] -46.7 MCshow
579
1.000 UL
580
LTb
581
LCb setrgbcolor
582
1938 448 M
583
0 63 V
584
0 4108 R
585
0 -63 V
586
stroke
587
1938 308 M
588
[ [(Helvetica) 140.0 0.0 true true 0 ( 5)]
589
] -46.7 MCshow
590
1.000 UL
591
LTb
592
LCb setrgbcolor
593
3190 448 M
594
0 63 V
595
0 4108 R
596
0 -63 V
597
stroke
598
3190 308 M
599
[ [(Helvetica) 140.0 0.0 true true 0 ( 10)]
600
] -46.7 MCshow
601
1.000 UL
602
LTb
603
LCb setrgbcolor
604
4443 448 M
605
0 63 V
606
0 4108 R
607
0 -63 V
608
stroke
609
4443 308 M
610
[ [(Helvetica) 140.0 0.0 true true 0 ( 15)]
611
] -46.7 MCshow
612
1.000 UL
613
LTb
614
LCb setrgbcolor
615
5695 448 M
616
0 63 V
617
0 4108 R
618
0 -63 V
619
stroke
620
5695 308 M
621
[ [(Helvetica) 140.0 0.0 true true 0 ( 20)]
622
] -46.7 MCshow
623
1.000 UL
624
LTb
625
LCb setrgbcolor
626
6947 448 M
627
0 63 V
628
0 4108 R
629
0 -63 V
630
stroke
631
6947 308 M
632
[ [(Helvetica) 140.0 0.0 true true 0 ( 25)]
633
] -46.7 MCshow
634
1.000 UL
635
LTb
636
LCb setrgbcolor
637
1.000 UL
638
LTb
639
LCb setrgbcolor
640
686 4619 N
641
686 448 L
642
6261 0 V
643
0 4171 V
644
-6261 0 V
645
Z stroke
646
LCb setrgbcolor
647
112 2533 M
648
currentpoint gsave translate -270 rotate 0 0 moveto
649
[ [(Helvetica) 140.0 0.0 true true 0 (Betweenness Centrality)]
650
] -46.7 MCshow
651
grestore
652
LTb
653
LCb setrgbcolor
654
3816 98 M
655
[ [(Helvetica) 140.0 0.0 true true 0 (Router \(each integer corresponds to one router\))]
656
] -46.7 MCshow
657
LTb
658
/Helvetica findfont 140 scalefont setfont
659
/vshift -46 def
660
3816 4829 M
661
(Centrality for jsoninfo_topo_weighted) Cshow
662
1.000 UP
663
1.000 UL
664
LTb
665
LCb setrgbcolor
666
% Begin plot #1
667
1.000 UP
668
1.000 UL
669
LT0
670
LC0 setrgbcolor
671
LCb setrgbcolor
672
6296 4486 M
673
[ [(Helvetica) 140.0 0.0 true true 0 (brandes weighted \(targets inclusion\))]
674
] -46.7 MRshow
675
LT0
676
686 719 BoxF
677
936 719 BoxF
678
1187 719 BoxF
679
1437 719 BoxF
680
1688 719 BoxF
681
1938 719 BoxF
682
2189 719 BoxF
683
2439 719 BoxF
684
2690 719 BoxF
685
2940 848 BoxF
686
3190 719 BoxF
687
3441 719 BoxF
688
3691 719 BoxF
689
3942 719 BoxF
690
4192 1237 BoxF
691
4443 1237 BoxF
692
4693 1566 BoxF
693
4943 2203 BoxF
694
5194 2077 BoxF
695
5444 2933 BoxF
696
5695 3467 BoxF
697
5945 3804 BoxF
698
6196 4275 BoxF
699
6446 4452 BoxF
700
6579 4486 BoxF
701
% End plot #1
702
% Begin plot #2
703
0.700 UP
704
1.000 UL
705
LT1
706
LC1 setrgbcolor
707
LCb setrgbcolor
708
6296 4346 M
709
[ [(Helvetica) 140.0 0.0 true true 0 (heuristic weighted \(not substracted by bc_inter\))]
710
] -46.7 MRshow
711
LT1
712
686 719 CircleF
713
936 719 CircleF
714
1187 719 CircleF
715
1437 719 CircleF
716
1688 719 CircleF
717
1938 719 CircleF
718
2189 719 CircleF
719
2439 719 CircleF
720
2690 719 CircleF
721
2940 719 CircleF
722
3190 719 CircleF
723
3441 719 CircleF
724
3691 719 CircleF
725
3942 719 CircleF
726
4192 1237 CircleF
727
4443 1237 CircleF
728
4693 1378 CircleF
729
4943 2203 CircleF
730
5194 2362 CircleF
731
5444 2933 CircleF
732
5695 3367 CircleF
733
5945 3804 CircleF
734
6196 4186 CircleF
735
6446 4463 CircleF
736
6579 4346 CircleF
737
% End plot #2
738
1.000 UL
739
LTb
740
LCb setrgbcolor
741
686 4619 N
742
686 448 L
743
6261 0 V
744
0 4171 V
745
-6261 0 V
746
Z stroke
747
1.000 UP
748
1.000 UL
749
LTb
750
LCb setrgbcolor
751
stroke
752
grestore
753
end
754
showpage
755
%%Trailer
756
%%DocumentFonts: Helvetica
custompackages/graph-parser/src/main.cpp
1
#include <cstdlib>
1 2
#include <iostream>
3
#include <string>
2 4
#include "parser.h"
3 5
#include "utility.h"
4 6
#include "centrality.h"
......
22 24
    gm.print();
23 25
}
24 26

  
25
void default_run(bool is_weighted_graph, bool targets_inclusion) {
27
void default_run(string filepath, int input_type, bool is_weighted_graph, bool targets_inclusion) {
26 28
    // input_files = [(filepath, input_type)]
27 29
    // input_type = 1 ==> edges file
28 30
    // input_type = 2 ==> simple json file
29 31
    // input_type = 3 ==> complex json file
30 32

  
31
    std::list< std::tuple<string, int> > input_files;
32
    input_files.push_back(std::make_tuple("../input/simple.edges", 1));
33
    input_files.push_back(std::make_tuple("../input/ninux_unweighted_connected.edges", 1));
34
    input_files.push_back(std::make_tuple("../input/ninux_30_1.edges", 1));
35
    input_files.push_back(std::make_tuple("../input/olsr-netjson.json", 2));
36
    input_files.push_back(std::make_tuple("../input/jsoninfo_topo.json", 3));
33
    GraphManager gm(is_weighted_graph);
37 34

  
38
    for (auto input : input_files) {
39
        string filepath = std::get<0>(input);
40
        int input_type = std::get<1>(input);
41

  
42
        GraphManager gm(is_weighted_graph);
43

  
44
        if (input_type == 1) {
45
            readEdgeFileGraphManager(filepath, gm);
46
        }
47
        else if (input_type == 2) {
48
            readJsonGraphManager(filepath, gm);
49
        }
50
        else if (input_type == 3) {
51
            readComplexJsonGraphManager(filepath, gm);
52
        }
35
    if (input_type == 1) {
36
        readEdgeFileGraphManager(filepath, gm);
37
    }
38
    else if (input_type == 2) {
39
        readJsonGraphManager(filepath, gm);
40
    }
41
    else if (input_type == 3) {
42
        readComplexJsonGraphManager(filepath, gm);
43
    }
53 44

  
54
        gm.print();
45
    gm.print();
55 46

  
56
        BiConnectedComponents bcc = BiConnectedComponents(gm);
57
        bcc.run();
47
    BiConnectedComponents bcc = BiConnectedComponents(gm);
48
    bcc.run();
58 49

  
59
        // Calculate Betweenness Centrality
60
        cout << "Calculate Betweenness Centrality\n";
61
        bcc.CalculateBetweennessCentrality(targets_inclusion);
62
        // bcc.print();
50
    // Calculate Betweenness Centrality
51
    cout << "Calculate Betweenness Centrality\n";
52
    bcc.CalculateBetweennessCentrality(targets_inclusion);
53
    // bcc.print();
63 54

  
64
        string filename;
65
        string ext;
66
        helper::get_file_name_and_extension(filepath, filename, ext);
55
    string filename;
56
    string ext;
57
    helper::get_file_name_and_extension(filepath, filename, ext);
67 58

  
68
        string out_filepath = "../output/" + filename;
69
        if (is_weighted_graph) {
70
            out_filepath += "_weighted.out";
71
        }
72
        else {
73
            out_filepath += "_unweighted.out";
74
        }
75
        bcc.write_all_betweenness_centrality(out_filepath);
59
    string out_filepath = "../output/" + filename;
60
    if (is_weighted_graph) {
61
        out_filepath += "_weighted.out";
62
    }
63
    else {
64
        out_filepath += "_unweighted.out";
76 65
    }
66
    bcc.write_all_betweenness_centrality(out_filepath);
77 67
}
78 68

  
79 69
void old_main_code() {
......
86 76
int main(int argc, char * argv[]) {
87 77
    bool is_weighted_graph = true;
88 78
    bool targets_inclusion = true;
79
    string filepath;
80
    int input_type;
81
    string argument;
89 82

  
90
    if (argc >= 2) {
91
        string argument(argv[1]);
83
    if (argc >= 3) {
84
        filepath = string(argv[1]);
85
        input_type = atoi(argv[2]);
86
    }
87
    if (argc >= 4) {
88
        argument = string(argv[3]);
92 89
        if (argument.compare("false") == 0) {
93 90
            is_weighted_graph = false;
94 91
        }
95 92

  
96
        if (argc > 2) {
97
           argument = string(argv[2]);
93
        if (argc > 4) {
94
           argument = string(argv[4]);
98 95
            if (argument.compare("false") == 0) {
99 96
                targets_inclusion = false;
100 97
            }
101 98
        }
102 99
    }
103 100

  
104
    default_run(is_weighted_graph, targets_inclusion);
101
    default_run(filepath, input_type, is_weighted_graph, targets_inclusion);
105 102

  
106 103
    cout << "is weighted graph  = " << is_weighted_graph << endl;
107 104
    return 0;
custompackages/graph-parser/src/parser.h
18 18
#endif //GRAPH_PARSER_PARSER_H
19 19

  
20 20

  
21

  
custompackages/graph-parser/src/script.sh
26 26
#########
27 27
## TRY TO AVOID MODIFYING ANYTHING BELOW THIS LINE
28 28
#########
29
## Compile the source code
29 30
make
30 31

  
31
## Remove all the previous output
32
# rm ../output/*.out
32
## Create output directories if they are not existed
33
declare -a dir_arr=("../output" "../output/visualization")
34
for i in "${dir_arr[@]}"
35
do
36
    echo $i;
37
    if [ ! -d $i ]; then
38
        mkdir $i;
39
    fi
40
done
33 41

  
42
filepath="../input/simple.edges"
43
input_type=1
34 44
## Running the script
35
../bin/main $WEIGHTED_GRAPH $TARGETS_INCLUSION
45
./graph-parser $filepath $input_type $WEIGHTED_GRAPH $TARGETS_INCLUSION
36 46

  
37 47
## Plotting the results
38 48
if [ $WEIGHTED_GRAPH = "true" ]
custompackages/graph-parser/src/utility.cpp
18 18
        std::vector<std::string> edgesVec;
19 19
        std::vector<double> costsVec;
20 20
        BGL_FORALL_EDGES(e, g, Graph) {
21
            std::string s = "(" + g[e.m_source].id + ", " + g[e.m_target].id + ") - " + std::to_string(g[e].cost);
21
            std::string s = "(" + g[e.m_source].id + ", " + g[e.m_target].id + ") - " + stdhelper::to_string(g[e].cost);
22 22
            edgesVec.push_back(s);
23 23
            costsVec.push_back(g[e].cost);
24 24
        }
......
51 51
            int index = boost::get(v_index_map, v);
52 52
            cout << g[v].id << ": " << v << endl;
53 53
            string vertex_id = g[v].id;
54
            outputs.push_back(vertex_id + ": " + std::to_string(index));
54
            outputs.push_back(vertex_id + ": " + stdhelper::to_string(index));
55 55
        }
56 56

  
57 57
        using namespace boost::spirit::karma;
......
123 123

  
124 124
        VertexIndexStdMap::const_iterator iter;
125 125
        for (iter = v_index_std_map.begin(); iter != v_index_std_map.end(); ++iter) {
126
            outputs.push_back(std::to_string(iter->second));
127
            // outputs.push_back(std::to_string(&(iter->first)) + ": " + std::to_string(iter->second));
126
            outputs.push_back(stdhelper::to_string(iter->second));
127
            // outputs.push_back(stdhelper::to_string(&(iter->first)) + ": " + stdhelper::to_string(iter->second));
128 128
        }
129 129

  
130 130
        using namespace boost::spirit::karma;
......
139 139
            std::string vertex_id = g[v].id;
140 140
            // Uncomment to print the address of vertex v
141 141
            // cout << v << endl;
142
            outputs.push_back(vertex_id + ": " + std::to_string(index));
142
            outputs.push_back(vertex_id + ": " + stdhelper::to_string(index));
143 143
        }
144 144

  
145 145
        using namespace boost::spirit::karma;
......
153 153
            int index = boost::get(e_index_pmap, e);
154 154
            std::string source_id = g[boost::source(e, g)].id;
155 155
            std::string target_id = g[boost::target(e, g)].id;
156
            outputs.push_back("edge (" + source_id + ", " + target_id + ")" + ": " + std::to_string(index));
156
            outputs.push_back("edge (" + source_id + ", " + target_id + ")" + ": " + stdhelper::to_string(index));
157 157
        }
158 158

  
159 159
        using namespace boost::spirit::karma;
custompackages/graph-parser/src/utility.h
8 8

  
9 9
#include <iostream>
10 10
#include <fstream>
11
#include <sstream>
11 12
#include <boost/graph/graph_traits.hpp>
12 13
#include <boost/graph/undirected_graph.hpp>
13 14
#include <boost/spirit/include/karma.hpp>
......
77 78
    template <typename T1, typename T2> bool exists(const std::map<T1, T2>& m, const T1& key);
78 79
    template <typename T> bool exists(const std::set<T>& s, const T& element);
79 80

  
81
    template <typename T>
82
    std::string to_string(T value);
80 83
}
81 84

  
82 85
namespace helper {
custompackages/graph-parser/src/utility.tpp
82 82
    bool exists(const std::set<T>& c, const T& key) {
83 83
        return (c.count(key) > 0);
84 84
    }
85

  
86
    template <typename T>
87
    std::string to_string(T value)
88
    {
89
        // From http://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-so-g
90

  
91
        //create an output string stream
92
        std::ostringstream os ;
93

  
94
        //throw the value into the string stream
95
        os << value ;
96

  
97
        //convert the string stream into a string and return
98
        return os.str() ;
99
    }
85 100
}
86 101

  

Also available in: Unified diff