↑ Collapse diff ↑
Ignore white space 6 line context
1
%!PS-Adobe-3.0 EPSF-3.0
2
%%BoundingBox: 15 18 829 570
3
%%HiResBoundingBox: 15.1913 18.4493 828.078 569.438
4
%%Creator: Karbon14 EPS Exportfilter 0.5
5
%%CreationDate: (04/15/06 15:20:26)
6
%%For: (Balazs Dezso) ()
7
%%Title: ()
8

	
9
/N {newpath} def
10
/C {closepath} def
11
/m {moveto} def
12
/c {curveto} def
13
/l {lineto} def
14
/s {stroke} def
15
/f {fill} def
16
/w {setlinewidth} def
17
/d {setdash} def
18
/r {setrgbcolor} def
19
/S {gsave} def
20
/R {grestore} def
21

	
22
N
23
251.402 32.047 m
24
532.945 293.946 814.484 555.844 814.484 555.844 c
25
[] 0 d 1 0 0 r 3.92814 w s
26

	
27
N
28
749.012 32.047 m
29
742.465 293.946 735.918 555.844 735.918 555.844 c
30
[] 0 d 0 0 0 r 1.96407 w s
31

	
32
N
33
539.492 32.047 m
34
637.703 293.946 735.918 555.844 735.918 555.844 c
35
[] 0 d 0 0 0 r 1.96407 w s
36

	
37
N
38
172.832 32.047 m
39
454.375 293.946 735.918 555.844 735.918 555.844 c
40
[] 0 d 0 0 0 r 1.96407 w s
41

	
42
N
43
107.355 32.047 m
44
421.637 293.946 735.918 555.844 735.918 555.844 c
45
[] 0 d 1 0 0 r 3.92814 w s
46

	
47
N
48
644.25 555.844 m
49
696.633 293.946 749.012 32.047 749.012 32.047 c
50
[] 0 d 0 0 0 r 1.96407 w s
51

	
52
N
53
474.016 555.844 m
54
611.516 293.946 749.012 32.047 749.012 32.047 c
55
[] 0 d 1 0 0 r 3.92814 w s
56

	
57
N
58
683.535 32.047 m
59
663.894 293.946 644.25 555.844 644.25 555.844 c
60
[] 0 d 0 0 0 r 1.96407 w s
61

	
62
N
63
120.453 555.844 m
64
401.992 293.946 683.535 32.047 683.535 32.047 c
65
[] 0 d 0 0 0 r 1.96407 w s
66

	
67
N
68
28.7853 555.844 m
69
356.16 293.946 683.535 32.047 683.535 32.047 c
70
[] 0 d 1 0 0 r 3.92814 w s
71

	
72
N
73
539.492 32.047 m
74
546.039 293.946 552.586 555.844 552.586 555.844 c
75
[] 0 d 1 0 0 r 3.92814 w s
76

	
77
N
78
316.875 32.047 m
79
349.613 293.946 382.351 555.844 382.351 555.844 c
80
[] 0 d 1 0 0 r 3.92814 w s
81

	
82
N
83
107.355 32.047 m
84
244.855 293.946 382.351 555.844 382.351 555.844 c
85
[] 0 d 0 0 0 r 1.96407 w s
86

	
87
N
88
290.687 555.844 m
89
375.805 293.946 460.922 32.047 460.922 32.047 c
90
[] 0 d 1 0 0 r 3.92814 w s
91

	
92
N
93
120.453 555.844 m
94
290.687 293.946 460.922 32.047 460.922 32.047 c
95
[] 0 d 0 0 0 r 1.96407 w s
96

	
97
N
98
172.832 32.047 m
99
146.64 293.946 120.453 555.844 120.453 555.844 c
100
[] 0 d 1 0 0 r 3.92814 w s
101

	
102
N
103
15.6913 555.844 m
104
15.6913 555.844 l
105
15.6913 548.614 21.5553 542.75 28.7853 542.75 c
106
36.0163 542.75 41.8833 548.614 41.8833 555.844 c
107
41.8833 563.075 36.0163 568.938 28.7853 568.938 c
108
21.5553 568.938 15.6913 563.075 15.6913 555.844 c
109
15.6913 555.844 l
110
C
111
S 0 0 0 r f R
112

	
113
N
114
16.8833 555.844 m
115
16.8833 555.844 l
116
16.8833 549.27 22.2113 543.942 28.7853 543.942 c
117
35.3593 543.942 40.6913 549.27 40.6913 555.844 c
118
40.6913 562.418 35.3593 567.747 28.7853 567.747 c
119
22.2113 567.747 16.8833 562.418 16.8833 555.844 c
120
16.8833 555.844 l
121
C
122
S 1 0.5 1 r f R
123

	
124
N
125
107.355 555.844 m
126
107.355 555.844 l
127
107.355 548.614 113.223 542.75 120.453 542.75 c
128
127.683 542.75 133.547 548.614 133.547 555.844 c
129
133.547 563.075 127.683 568.938 120.453 568.938 c
130
113.223 568.938 107.355 563.075 107.355 555.844 c
131
107.355 555.844 l
132
C
133
S 0 0 0 r f R
134

	
135
N
136
108.547 555.844 m
137
108.547 555.844 l
138
108.547 549.27 113.879 543.942 120.453 543.942 c
139
127.027 543.942 132.355 549.27 132.355 555.844 c
140
132.355 562.418 127.027 567.747 120.453 567.747 c
141
113.879 567.747 108.547 562.418 108.547 555.844 c
142
108.547 555.844 l
143
C
144
S 1 0 1 r f R
145

	
146
N
147
199.019 555.844 m
148
199.019 555.844 l
149
199.019 548.614 204.887 542.75 212.117 542.75 c
150
219.348 542.75 225.211 548.614 225.211 555.844 c
151
225.211 563.075 219.348 568.938 212.117 568.938 c
152
204.887 568.938 199.019 563.075 199.019 555.844 c
153
199.019 555.844 l
154
C
155
S 0 0 0 r f R
156

	
157
N
158
200.211 555.844 m
159
200.211 555.844 l
160
200.211 549.27 205.543 543.942 212.117 543.942 c
161
218.691 543.942 224.019 549.27 224.019 555.844 c
162
224.019 562.418 218.691 567.747 212.117 567.747 c
163
205.543 567.747 200.211 562.418 200.211 555.844 c
164
200.211 555.844 l
165
C
166
S 1 0.5 1 r f R
167

	
168
N
169
277.59 555.844 m
170
277.59 555.844 l
171
277.59 548.614 283.457 542.75 290.687 542.75 c
172
297.918 542.75 303.781 548.614 303.781 555.844 c
173
303.781 563.075 297.918 568.938 290.687 568.938 c
174
283.457 568.938 277.59 563.075 277.59 555.844 c
175
277.59 555.844 l
176
C
177
S 0 0 0 r f R
178

	
179
N
180
278.781 555.844 m
181
278.781 555.844 l
182
278.781 549.27 284.113 543.942 290.687 543.942 c
183
297.262 543.942 302.59 549.27 302.59 555.844 c
184
302.59 562.418 297.262 567.747 290.687 567.747 c
185
284.113 567.747 278.781 562.418 278.781 555.844 c
186
278.781 555.844 l
187
C
188
S 1 0 1 r f R
189

	
190
N
191
369.258 555.844 m
192
369.258 555.844 l
193
369.258 548.614 375.121 542.75 382.351 542.75 c
194
389.582 542.75 395.445 548.614 395.445 555.844 c
195
395.445 563.075 389.582 568.938 382.351 568.938 c
196
375.121 568.938 369.258 563.075 369.258 555.844 c
197
369.258 555.844 l
198
C
199
S 0 0 0 r f R
200

	
201
N
202
370.445 555.844 m
203
370.445 555.844 l
204
370.445 549.27 375.777 543.942 382.351 543.942 c
205
388.926 543.942 394.258 549.27 394.258 555.844 c
206
394.258 562.418 388.926 567.747 382.351 567.747 c
207
375.777 567.747 370.445 562.418 370.445 555.844 c
208
370.445 555.844 l
209
C
210
S 1 0 1 r f R
211

	
212
N
213
460.922 555.844 m
214
460.922 555.844 l
215
460.922 548.614 466.785 542.75 474.016 542.75 c
216
481.246 542.75 487.109 548.614 487.109 555.844 c
217
487.109 563.075 481.246 568.938 474.016 568.938 c
218
466.785 568.938 460.922 563.075 460.922 555.844 c
219
460.922 555.844 l
220
C
221
S 0 0 0 r f R
222

	
223
N
224
462.113 555.844 m
225
462.113 555.844 l
226
462.113 549.27 467.441 543.942 474.016 543.942 c
227
480.59 543.942 485.922 549.27 485.922 555.844 c
228
485.922 562.418 480.59 567.747 474.016 567.747 c
229
467.441 567.747 462.113 562.418 462.113 555.844 c
230
462.113 555.844 l
231
C
232
S 1 0.5 1 r f R
233

	
234
N
235
539.492 555.844 m
236
539.492 555.844 l
237
539.492 548.614 545.355 542.75 552.586 542.75 c
238
559.816 542.75 565.68 548.614 565.68 555.844 c
239
565.68 563.075 559.816 568.938 552.586 568.938 c
240
545.355 568.938 539.492 563.075 539.492 555.844 c
241
539.492 555.844 l
242
C
243
S 0 0 0 r f R
244

	
245
N
246
540.683 555.844 m
247
540.683 555.844 l
248
540.683 549.27 546.012 543.942 552.586 543.942 c
249
559.16 543.942 564.492 549.27 564.492 555.844 c
250
564.492 562.418 559.16 567.747 552.586 567.747 c
251
546.012 567.747 540.683 562.418 540.683 555.844 c
252
540.683 555.844 l
253
C
254
S 1 0 1 r f R
255

	
256
N
257
631.156 555.844 m
258
631.156 555.844 l
259
631.156 548.614 637.019 542.75 644.25 542.75 c
260
651.48 542.75 657.348 548.614 657.348 555.844 c
261
657.348 563.075 651.48 568.938 644.25 568.938 c
262
637.019 568.938 631.156 563.075 631.156 555.844 c
263
631.156 555.844 l
264
C
265
S 0 0 0 r f R
266

	
267
N
268
632.348 555.844 m
269
632.348 555.844 l
270
632.348 549.27 637.676 543.942 644.25 543.942 c
271
650.824 543.942 656.156 549.27 656.156 555.844 c
272
656.156 562.418 650.824 567.747 644.25 567.747 c
273
637.676 567.747 632.348 562.418 632.348 555.844 c
274
632.348 555.844 l
275
C
276
S 1 0.5 1 r f R
277

	
278
N
279
722.82 555.844 m
280
722.82 555.844 l
281
722.82 548.614 728.687 542.75 735.918 542.75 c
282
743.149 542.75 749.012 548.614 749.012 555.844 c
283
749.012 563.075 743.149 568.938 735.918 568.938 c
284
728.687 568.938 722.82 563.075 722.82 555.844 c
285
722.82 555.844 l
286
C
287
S 0 0 0 r f R
288

	
289
N
290
724.012 555.844 m
291
724.012 555.844 l
292
724.012 549.27 729.344 543.942 735.918 543.942 c
293
742.492 543.942 747.82 549.27 747.82 555.844 c
294
747.82 562.418 742.492 567.747 735.918 567.747 c
295
729.344 567.747 724.012 562.418 724.012 555.844 c
296
724.012 555.844 l
297
C
298
S 1 0 1 r f R
299

	
300
N
301
801.391 555.844 m
302
801.391 555.844 l
303
801.391 548.614 807.254 542.75 814.484 542.75 c
304
821.715 542.75 827.578 548.614 827.578 555.844 c
305
827.578 563.075 821.715 568.938 814.484 568.938 c
306
807.254 568.938 801.391 563.075 801.391 555.844 c
307
801.391 555.844 l
308
C
309
S 0 0 0 r f R
310

	
311
N
312
802.582 555.844 m
313
802.582 555.844 l
314
802.582 549.27 807.91 543.942 814.484 543.942 c
315
821.059 543.942 826.387 549.27 826.387 555.844 c
316
826.387 562.418 821.059 567.747 814.484 567.747 c
317
807.91 567.747 802.582 562.418 802.582 555.844 c
318
802.582 555.844 l
319
C
320
S 1 0 1 r f R
321

	
322
N
323
15.6913 32.047 m
324
15.6913 32.047 l
325
15.6913 24.8165 21.5553 18.9493 28.7853 18.9493 c
326
36.0163 18.9493 41.8833 24.8165 41.8833 32.047 c
327
41.8833 39.2775 36.0163 45.1407 28.7853 45.1407 c
328
21.5553 45.1407 15.6913 39.2775 15.6913 32.047 c
329
15.6913 32.047 l
330
C
331
S 0 0 0 r f R
332

	
333
N
334
16.8833 32.047 m
335
16.8833 32.047 l
336
16.8833 25.4728 22.2113 20.1407 28.7853 20.1407 c
337
35.3593 20.1407 40.6913 25.4728 40.6913 32.047 c
338
40.6913 38.6212 35.3593 43.9493 28.7853 43.9493 c
339
22.2113 43.9493 16.8833 38.6212 16.8833 32.047 c
340
16.8833 32.047 l
341
C
342
S 0.5 0.5 1 r f R
343

	
344
N
345
94.2623 32.047 m
346
94.2623 32.047 l
347
94.2623 24.8165 100.125 18.9493 107.355 18.9493 c
348
114.586 18.9493 120.453 24.8165 120.453 32.047 c
349
120.453 39.2775 114.586 45.1407 107.355 45.1407 c
350
100.125 45.1407 94.2623 39.2775 94.2623 32.047 c
351
94.2623 32.047 l
352
C
353
S 0 0 0 r f R
354

	
355
N
356
95.4533 32.047 m
357
95.4533 32.047 l
358
95.4533 25.4728 100.781 20.1407 107.355 20.1407 c
359
113.93 20.1407 119.262 25.4728 119.262 32.047 c
360
119.262 38.6212 113.93 43.9493 107.355 43.9493 c
361
100.781 43.9493 95.4533 38.6212 95.4533 32.047 c
362
95.4533 32.047 l
363
C
364
S 0.5 0.5 1 r f R
365

	
366
N
367
159.734 32.047 m
368
159.734 32.047 l
369
159.734 24.8165 165.601 18.9493 172.832 18.9493 c
370
180.062 18.9493 185.926 24.8165 185.926 32.047 c
371
185.926 39.2775 180.062 45.1407 172.832 45.1407 c
372
165.601 45.1407 159.734 39.2775 159.734 32.047 c
373
159.734 32.047 l
374
C
375
S 0 0 0 r f R
376

	
377
N
378
160.926 32.047 m
379
160.926 32.047 l
380
160.926 25.4728 166.258 20.1407 172.832 20.1407 c
381
179.406 20.1407 184.734 25.4728 184.734 32.047 c
382
184.734 38.6212 179.406 43.9493 172.832 43.9493 c
383
166.258 43.9493 160.926 38.6212 160.926 32.047 c
384
160.926 32.047 l
385
C
386
S 0.5 0.5 1 r f R
387

	
388
N
389
238.305 32.047 m
390
238.305 32.047 l
391
238.305 24.8165 244.172 18.9493 251.402 18.9493 c
392
258.633 18.9493 264.496 24.8165 264.496 32.047 c
393
264.496 39.2775 258.633 45.1407 251.402 45.1407 c
394
244.172 45.1407 238.305 39.2775 238.305 32.047 c
395
238.305 32.047 l
396
C
397
S 0 0 0 r f R
398

	
399
N
400
239.496 32.047 m
401
239.496 32.047 l
402
239.496 25.4728 244.828 20.1407 251.402 20.1407 c
403
257.976 20.1407 263.305 25.4728 263.305 32.047 c
404
263.305 38.6212 257.976 43.9493 251.402 43.9493 c
405
244.828 43.9493 239.496 38.6212 239.496 32.047 c
406
239.496 32.047 l
407
C
408
S 0.5 0.5 1 r f R
409

	
410
N
411
303.781 32.047 m
412
303.781 32.047 l
413
303.781 24.8165 309.644 18.9493 316.875 18.9493 c
414
324.105 18.9493 329.973 24.8165 329.973 32.047 c
415
329.973 39.2775 324.105 45.1407 316.875 45.1407 c
416
309.644 45.1407 303.781 39.2775 303.781 32.047 c
417
303.781 32.047 l
418
C
419
S 0 0 0 r f R
420

	
421
N
422
304.973 32.047 m
423
304.973 32.047 l
424
304.973 25.4728 310.301 20.1407 316.875 20.1407 c
425
323.449 20.1407 328.781 25.4728 328.781 32.047 c
426
328.781 38.6212 323.449 43.9493 316.875 43.9493 c
427
310.301 43.9493 304.973 38.6212 304.973 32.047 c
428
304.973 32.047 l
429
C
430
S 0.5 0.5 1 r f R
431

	
432
N
433
382.351 32.047 m
434
382.351 32.047 l
435
382.351 24.8165 388.215 18.9493 395.445 18.9493 c
436
402.676 18.9493 408.543 24.8165 408.543 32.047 c
437
408.543 39.2775 402.676 45.1407 395.445 45.1407 c
438
388.215 45.1407 382.351 39.2775 382.351 32.047 c
439
382.351 32.047 l
440
C
441
S 0 0 0 r f R
442

	
443
N
444
383.543 32.047 m
445
383.543 32.047 l
446
383.543 25.4728 388.871 20.1407 395.445 20.1407 c
447
402.019 20.1407 407.351 25.4728 407.351 32.047 c
448
407.351 38.6212 402.019 43.9493 395.445 43.9493 c
449
388.871 43.9493 383.543 38.6212 383.543 32.047 c
450
383.543 32.047 l
451
C
452
S 0.5 0.5 1 r f R
453

	
454
N
455
447.828 32.047 m
456
447.828 32.047 l
457
447.828 24.8165 453.691 18.9493 460.922 18.9493 c
458
468.152 18.9493 474.016 24.8165 474.016 32.047 c
459
474.016 39.2775 468.152 45.1407 460.922 45.1407 c
460
453.691 45.1407 447.828 39.2775 447.828 32.047 c
461
447.828 32.047 l
462
C
463
S 0 0 0 r f R
464

	
465
N
466
449.016 32.047 m
467
449.016 32.047 l
468
449.016 25.4728 454.348 20.1407 460.922 20.1407 c
469
467.496 20.1407 472.824 25.4728 472.824 32.047 c
470
472.824 38.6212 467.496 43.9493 460.922 43.9493 c
471
454.348 43.9493 449.016 38.6212 449.016 32.047 c
472
449.016 32.047 l
473
C
474
S 0.5 0.5 1 r f R
475

	
476
N
477
526.394 32.047 m
478
526.394 32.047 l
479
526.394 24.8165 532.262 18.9493 539.492 18.9493 c
480
546.723 18.9493 552.586 24.8165 552.586 32.047 c
481
552.586 39.2775 546.723 45.1407 539.492 45.1407 c
482
532.262 45.1407 526.394 39.2775 526.394 32.047 c
483
526.394 32.047 l
484
C
485
S 0 0 0 r f R
486

	
487
N
488
527.586 32.047 m
489
527.586 32.047 l
490
527.586 25.4728 532.918 20.1407 539.492 20.1407 c
491
546.066 20.1407 551.394 25.4728 551.394 32.047 c
492
551.394 38.6212 546.066 43.9493 539.492 43.9493 c
493
532.918 43.9493 527.586 38.6212 527.586 32.047 c
494
527.586 32.047 l
495
C
496
S 0.5 0.5 1 r f R
497

	
498
N
499
591.871 32.047 m
500
591.871 32.047 l
501
591.871 24.8165 597.734 18.9493 604.965 18.9493 c
502
612.195 18.9493 618.062 24.8165 618.062 32.047 c
503
618.062 39.2775 612.195 45.1407 604.965 45.1407 c
504
597.734 45.1407 591.871 39.2775 591.871 32.047 c
505
591.871 32.047 l
506
C
507
S 0 0 0 r f R
508

	
509
N
510
593.062 32.047 m
511
593.062 32.047 l
512
593.062 25.4728 598.39 20.1407 604.965 20.1407 c
513
611.539 20.1407 616.871 25.4728 616.871 32.047 c
514
616.871 38.6212 611.539 43.9493 604.965 43.9493 c
515
598.39 43.9493 593.062 38.6212 593.062 32.047 c
516
593.062 32.047 l
517
C
518
S 0.5 0.5 1 r f R
519

	
520
N
521
670.441 32.047 m
522
670.441 32.047 l
523
670.441 24.8165 676.305 18.9493 683.535 18.9493 c
524
690.766 18.9493 696.633 24.8165 696.633 32.047 c
525
696.633 39.2775 690.766 45.1407 683.535 45.1407 c
526
676.305 45.1407 670.441 39.2775 670.441 32.047 c
527
670.441 32.047 l
528
C
529
S 0 0 0 r f R
530

	
531
N
532
671.633 32.047 m
533
671.633 32.047 l
534
671.633 25.4728 676.961 20.1407 683.535 20.1407 c
535
690.109 20.1407 695.441 25.4728 695.441 32.047 c
536
695.441 38.6212 690.109 43.9493 683.535 43.9493 c
537
676.961 43.9493 671.633 38.6212 671.633 32.047 c
538
671.633 32.047 l
539
C
540
S 0 0 1 r f R
541

	
542
N
543
735.918 32.047 m
544
735.918 32.047 l
545
735.918 24.8165 741.781 18.9493 749.012 18.9493 c
546
756.242 18.9493 762.106 24.8165 762.106 32.047 c
547
762.106 39.2775 756.242 45.1407 749.012 45.1407 c
548
741.781 45.1407 735.918 39.2775 735.918 32.047 c
549
735.918 32.047 l
550
C
551
S 0 0 0 r f R
552

	
553
N
554
737.105 32.047 m
555
737.105 32.047 l
556
737.105 25.4728 742.437 20.1407 749.012 20.1407 c
557
755.586 20.1407 760.914 25.4728 760.914 32.047 c
558
760.914 38.6212 755.586 43.9493 749.012 43.9493 c
559
742.437 43.9493 737.105 38.6212 737.105 32.047 c
560
737.105 32.047 l
561
C
562
S 0 0 1 r f R
563

	
564
N
565
801.391 32.047 m
566
801.391 32.047 l
567
801.391 24.8165 807.254 18.9493 814.484 18.9493 c
568
821.715 18.9493 827.578 24.8165 827.578 32.047 c
569
827.578 39.2775 821.715 45.1407 814.484 45.1407 c
570
807.254 45.1407 801.391 39.2775 801.391 32.047 c
571
801.391 32.047 l
572
C
573
S 0 0 0 r f R
574

	
575
N
576
802.582 32.047 m
577
802.582 32.047 l
578
802.582 25.4728 807.91 20.1407 814.484 20.1407 c
579
821.059 20.1407 826.387 25.4728 826.387 32.047 c
580
826.387 38.6212 821.059 43.9493 814.484 43.9493 c
581
807.91 43.9493 802.582 38.6212 802.582 32.047 c
582
802.582 32.047 l
583
C
584
S 0.5 0.5 1 r f R
585

	
586
%%EOF
1
%!PS-Adobe-2.0 EPSF-2.0
2
%%Creator: LEMON, graphToEps()
3
%%CreationDate: Tue Nov 15 16:51:43 2005
4
%%BoundingBox: 0 0 596 842
5
%%DocumentPaperSizes: a4
6
%%EndComments
7
/lb { setlinewidth setrgbcolor newpath moveto
8
      4 2 roll 1 index 1 index curveto stroke } bind def
9
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
10
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
11
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
12
      2 index 1 index sub 2 index 2 index add lineto
13
      2 index 1 index sub 2 index 2 index sub lineto
14
      2 index 1 index add 2 index 2 index sub lineto
15
      closepath pop pop pop} bind def
16
/di { newpath 2 index 1 index add 2 index moveto
17
      2 index             2 index 2 index add lineto
18
      2 index 1 index sub 2 index             lineto
19
      2 index             2 index 2 index sub lineto
20
      closepath pop pop pop} bind def
21
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
22
     setrgbcolor 1.1 div c fill
23
   } bind def
24
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
25
     setrgbcolor 1.1 div sq fill
26
   } bind def
27
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
28
     setrgbcolor 1.1 div di fill
29
   } bind def
30
/arrl 1 def
31
/arrw 0.3 def
32
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
33
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
34
       /w exch def /len exch def
35
       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
36
       len w sub arrl sub dx dy lrl
37
       arrw dy dx neg lrl
38
       dx arrl w add mul dy w 2 div arrw add mul sub
39
       dy arrl w add mul dx w 2 div arrw add mul add rlineto
40
       dx arrl w add mul neg dy w 2 div arrw add mul sub
41
       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
42
       arrw dy dx neg lrl
43
       len w sub arrl sub neg dx dy lrl
44
       closepath fill } bind def
45
/cshow { 2 index 2 index moveto dup stringwidth pop
46
         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
47

	
48
gsave
49
71.6378 15 translate
50
0.389093 dup scale
51
90 rotate
52
1197.47 -613.138 translate
53
%Edges:
54
gsave
55
513.857 -446.322 296.569 -487.43 79.2808 -528.539 0 0 0 2 lb
56
513.857 -446.322 575.52 -315.655 637.183 -184.989 0 0 0 2 lb
57
393.468 566.711 494.771 434.577 596.074 302.442 0 0 0 2 lb
58
393.468 566.711 155.625 579.925 -82.2171 593.138 0 0 0 2 lb
59
393.468 566.711 251.056 450.726 108.644 334.741 0 0 0 2 lb
60
869.153 52.8539 732.613 177.648 596.074 302.442 0 0 0 2 lb
61
869.153 52.8539 753.168 -66.0676 637.183 -184.989 0 0 0 2 lb
62
-82.2171 593.138 -91.0261 346.487 -99.8351 99.8351 0 0 0 2 lb
63
-663.61 546.157 -753.168 394.936 -842.726 243.715 0 0 0 2 lb
64
-663.61 546.157 -574.052 437.513 -484.494 328.869 0 0 0 2 lb
65
-1077.63 161.498 -960.178 202.606 -842.726 243.715 0 0 0 2 lb
66
-1077.63 161.498 -968.987 66.0674 -860.344 -29.3633 0 0 0 2 lb
67
-1177.47 -234.906 -1029.18 -381.722 -880.898 -528.539 0 0 0 2 lb
68
-1177.47 -234.906 -1018.91 -132.135 -860.344 -29.3633 0 0 0 2 lb
69
-880.898 -528.539 -744.359 -387.595 -607.82 -246.651 0 0 0 2 lb
70
-499.175 -499.175 -355.295 -475.685 -211.415 -452.194 0 0 0 2 lb
71
-499.175 -499.175 -553.498 -372.913 -607.82 -246.651 0 0 0 2 lb
72
-499.175 -499.175 -386.587 -315.087 -274 -131 0 0 0 2 lb
73
79.2808 -528.539 -66.0671 -490.366 -211.415 -452.194 0 0 0 2 lb
74
637.183 -184.989 421.363 -253.993 205.543 -322.996 0 0 0 2 lb
75
205.543 -322.996 162.966 -226.097 120.389 -129.198 0 0 0 2 lb
76
399.34 88.0898 259.865 -20.5541 120.389 -129.198 0 0 0 2 lb
77
399.34 88.0898 253.992 211.415 108.644 334.741 0 0 0 2 lb
78
-842.726 243.715 -471.281 171.775 -99.8351 99.8351 0 0 0 2 lb
79
-842.726 243.715 -558.363 56.3575 -274 -131 0 0 0 2 lb
80
-860.344 -29.3633 -734.082 -138.007 -607.82 -246.651 0 0 0 2 lb
81
-211.415 -452.194 -45.513 -290.696 120.389 -129.198 0 0 0 2 lb
82
-99.8351 99.8351 4.40445 217.288 108.644 334.741 0 0 0 2 lb
83
-99.8351 99.8351 -292.165 214.352 -484.494 328.869 0 0 0 2 lb
84
120.389 -129.198 -76.8055 -130.099 -274 -131 0 0 0 2 lb
85
grestore
86
%Nodes:
87
gsave
88
-274 -131 20 1 0 0 nc
89
-607.82 -246.651 20 1 0 0 nc
90
-484.494 328.869 20 0 0 1 nc
91
108.644 334.741 20 0 0 1 nc
92
120.389 -129.198 20 0 0 1 nc
93
-99.8351 99.8351 20 1 0 0 nc
94
-211.415 -452.194 20 1 0 0 nc
95
-860.344 -29.3633 20 0 0 1 nc
96
-842.726 243.715 20 0 0 1 nc
97
399.34 88.0898 20 1 0 0 nc
98
205.543 -322.996 20 1 0 0 nc
99
637.183 -184.989 20 0 0 1 nc
100
79.2808 -528.539 20 0 0 1 nc
101
-499.175 -499.175 20 0 0 1 nc
102
-880.898 -528.539 20 0 0 1 nc
103
-1177.47 -234.906 20 1 0 0 nc
104
-1077.63 161.498 20 1 0 0 nc
105
-663.61 546.157 20 1 0 0 nc
106
-82.2171 593.138 20 0 0 1 nc
107
596.074 302.442 20 0 0 1 nc
108
869.153 52.8539 20 1 0 0 nc
109
393.468 566.711 20 1 0 0 nc
110
513.857 -446.322 20 1 0 0 nc
111
grestore
112
grestore
113
showpage
1
%!PS-Adobe-2.0 EPSF-2.0
2
%%Creator: LEMON, graphToEps()
3
%%CreationDate: Fri Nov  4 13:47:12 2005
4
%%BoundingBox: 0 0 596 842
5
%%DocumentPaperSizes: a4
6
%%EndComments
7
/lb { setlinewidth setrgbcolor newpath moveto
8
      4 2 roll 1 index 1 index curveto stroke } bind def
9
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
10
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
11
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
12
      2 index 1 index sub 2 index 2 index add lineto
13
      2 index 1 index sub 2 index 2 index sub lineto
14
      2 index 1 index add 2 index 2 index sub lineto
15
      closepath pop pop pop} bind def
16
/di { newpath 2 index 1 index add 2 index moveto
17
      2 index             2 index 2 index add lineto
18
      2 index 1 index sub 2 index             lineto
19
      2 index             2 index 2 index sub lineto
20
      closepath pop pop pop} bind def
21
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
22
     setrgbcolor 1.1 div c fill
23
   } bind def
24
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
25
     setrgbcolor 1.1 div sq fill
26
   } bind def
27
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
28
     setrgbcolor 1.1 div di fill
29
   } bind def
30
/arrl 1 def
31
/arrw 0.3 def
32
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
33
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
34
       /w exch def /len exch def
35
       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
36
       len w sub arrl sub dx dy lrl
37
       arrw dy dx neg lrl
38
       dx arrl w add mul dy w 2 div arrw add mul sub
39
       dy arrl w add mul dx w 2 div arrw add mul add rlineto
40
       dx arrl w add mul neg dy w 2 div arrw add mul sub
41
       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
42
       arrw dy dx neg lrl
43
       len w sub arrl sub neg dx dy lrl
44
       closepath fill } bind def
45
/cshow { 2 index 2 index moveto dup stringwidth pop
46
         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
47

	
48
gsave
49
71.0944 15 translate
50
0.434694 dup scale
51
90 rotate
52
860.856 -588.349 translate
53
%Edges:
54
gsave
55
574.035 177.301 622.149 225.748 670.264 274.195 0 0 0 2 lb
56
694.579 115.483 682.421 194.839 670.264 274.195 0 0 0 2 lb
57
280.402 10.3938 246.402 -6.60595 212.403 -23.6057 0 0 0 2 lb
58
280.402 10.3938 283.493 -18.9695 286.584 -48.3327 0 0 0 2 lb
59
212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 0 0 0 2 lb
60
286.584 -48.3327 326.765 -79.2414 366.947 -110.15 0 0 0 2 lb
61
286.584 -48.3327 278.857 -111.695 271.13 -175.058 0 0 0 2 lb
62
438.037 -88.514 417.946 -142.604 397.855 -196.694 0 0 0 2 lb
63
438.037 -88.514 402.492 -99.332 366.947 -110.15 0 0 0 2 lb
64
397.855 -196.694 382.401 -153.422 366.947 -110.15 0 0 0 2 lb
65
366.947 -110.15 319.038 -142.604 271.13 -175.058 0 0 0 2 lb
66
271.13 -175.058 274.221 -213.694 277.311 -252.33 0 0 0 2 lb
67
271.13 -175.058 238.675 -190.512 206.221 -205.967 0 0 0 2 lb
68
277.311 -252.33 241.766 -229.149 206.221 -205.967 0 0 0 2 lb
69
-840.856 -246.718 -804.351 -66.7145 -767.847 113.289 0 0 0 2 lb
70
-579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 0 2 lb
71
-579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 0 2 lb
72
-767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 0 2 lb
73
906.312 201.403 946.592 42.798 986.873 -115.807 0 0 0 2 lb
74
906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0 0 2 lb
75
986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0 0 2 lb
76
-470.779 158.605 -390.218 50.3508 -309.657 -57.9033 0 0 0 2 lb
77
422.945 521.129 208.955 541.269 -5.03507 561.41 0 0 0 2 lb
78
422.945 521.129 376.371 417.911 329.797 314.692 0 0 0 2 lb
79
422.945 521.129 474.554 276.928 526.164 32.7279 0 0 0 2 lb
80
-5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0 0 0 2 lb
81
329.797 314.692 130.912 317.209 -67.9734 319.727 0 0 0 2 lb
82
-67.9734 319.727 229.095 176.227 526.164 32.7279 0 0 0 2 lb
83
762.812 -17.6227 644.488 7.5526 526.164 32.7279 0 0 0 2 lb
84
762.812 -17.6227 746.448 -162.381 730.084 -307.139 0 0 0 2 lb
85
526.164 32.7279 470.779 -128.394 415.393 -289.516 0 0 0 2 lb
86
730.084 -307.139 572.738 -298.327 415.393 -289.516 0 0 0 2 lb
87
415.393 -289.516 173.71 -318.468 -67.9734 -347.42 0 0 0 2 lb
88
-67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0 0 0 2 lb
89
-67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0 0 0 2 lb
90
-309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0 0 0 2 lb
91
-323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0 0 0 2 lb
92
-26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 0 0 0 2 lb
93
-26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 0 0 0 2 lb
94
-26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 0 0 0 2 lb
95
-26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 0 0 0 2 lb
96
116.407 -173.66 158.808 -67.6589 201.208 38.3422 0 0 0 2 lb
97
-262.548 107.243 -137.997 120.493 -13.4452 133.743 0 0 0 2 lb
98
-262.548 107.243 -221.472 176.144 -180.397 245.045 0 0 0 2 lb
99
-13.4452 133.743 -96.9211 189.394 -180.397 245.045 0 0 0 2 lb
100
-180.397 245.045 -142.256 345.099 -132.697 451.748 0 0 0 2 lb
101
-180.397 245.045 -170.838 351.694 -132.697 451.748 0 0 0 2 lb
102
-416.25 345.746 -274.474 398.747 -132.697 451.748 0 0 0 2 lb
103
-416.25 345.746 -393.725 457.048 -371.2 568.349 0 0 0 2 lb
104
-132.697 451.748 -251.948 510.048 -371.2 568.349 0 0 0 2 lb
105
670.264 274.195 629.188 409.347 588.113 544.499 0 0 0 2 lb
106
670.264 274.195 797.466 341.771 924.667 409.347 0 0 0 2 lb
107
588.113 544.499 756.39 476.923 924.667 409.347 0 0 0 2 lb
108
-689.204 -237.261 -614.799 -102.648 -567.302 43.6423 0 0 0 2 lb
109
-689.204 -237.261 -641.707 -90.9706 -567.302 43.6423 0 0 0 2 lb
110
grestore
111
%Nodes:
112
gsave
113
-567.302 43.6423 20 0 0 0 nc
114
-689.204 -237.261 20 0 0 0 nc
115
924.667 409.347 20 1 0 0 nc
116
588.113 544.499 20 1 0 0 nc
117
670.264 274.195 20 1 0 0 nc
118
-371.2 568.349 20 0 1 0 nc
119
-132.697 451.748 20 0 1 0 nc
120
-416.25 345.746 20 0 1 0 nc
121
-180.397 245.045 20 0 1 0 nc
122
-13.4452 133.743 20 0 1 0 nc
123
-262.548 107.243 20 0 1 0 nc
124
201.208 38.3422 20 0 1 0 nc
125
116.407 -173.66 20 0 1 0 nc
126
-26.6953 -19.9585 20 0 1 0 nc
127
-539.894 -262.64 20 0 0 1 nc
128
-323.543 -433.964 20 0 0 1 nc
129
-309.657 -57.9033 20 0 0 1 nc
130
-67.9734 -347.42 20 0 0 1 nc
131
415.393 -289.516 20 0 0 1 nc
132
730.084 -307.139 20 0 0 1 nc
133
526.164 32.7279 20 0 0 1 nc
134
762.812 -17.6227 20 0 0 1 nc
135
-67.9734 319.727 20 0 0 1 nc
136
329.797 314.692 20 0 0 1 nc
137
-5.03507 561.41 20 0 0 1 nc
138
422.945 521.129 20 0 0 1 nc
139
-470.779 158.605 20 0 0 1 nc
140
986.873 -115.807 20 0 0 1 nc
141
906.312 201.403 20 0 0 1 nc
142
-767.847 113.289 20 0 0 1 nc
143
-579.033 445.603 20 0 0 1 nc
144
-840.856 -246.718 20 0 0 1 nc
145
206.221 -205.967 20 1 1 0 nc
146
277.311 -252.33 20 1 1 0 nc
147
271.13 -175.058 20 1 1 0 nc
148
366.947 -110.15 20 1 1 0 nc
149
397.855 -196.694 20 1 1 0 nc
150
438.037 -88.514 20 1 1 0 nc
151
286.584 -48.3327 20 1 1 0 nc
152
212.403 -23.6057 20 1 1 0 nc
153
280.402 10.3938 20 1 1 0 nc
154
694.579 115.483 20 1 0 0 nc
155
574.035 177.301 20 1 0 0 nc
156
grestore
157
grestore
158
showpage
1
%!PS-Adobe-2.0 EPSF-2.0
2
%%Creator: LEMON, graphToEps()
3
%%CreationDate: Fri Nov  4 13:47:12 2005
4
%%BoundingBox: 0 0 596 842
5
%%DocumentPaperSizes: a4
6
%%EndComments
7
/lb { setlinewidth setrgbcolor newpath moveto
8
      4 2 roll 1 index 1 index curveto stroke } bind def
9
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
10
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
11
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
12
      2 index 1 index sub 2 index 2 index add lineto
13
      2 index 1 index sub 2 index 2 index sub lineto
14
      2 index 1 index add 2 index 2 index sub lineto
15
      closepath pop pop pop} bind def
16
/di { newpath 2 index 1 index add 2 index moveto
17
      2 index             2 index 2 index add lineto
18
      2 index 1 index sub 2 index             lineto
19
      2 index             2 index 2 index sub lineto
20
      closepath pop pop pop} bind def
21
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
22
     setrgbcolor 1.1 div c fill
23
   } bind def
24
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
25
     setrgbcolor 1.1 div sq fill
26
   } bind def
27
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
28
     setrgbcolor 1.1 div di fill
29
   } bind def
30
/arrl 1 def
31
/arrw 0.3 def
32
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
33
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
34
       /w exch def /len exch def
35
       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
36
       len w sub arrl sub dx dy lrl
37
       arrw dy dx neg lrl
38
       dx arrl w add mul dy w 2 div arrw add mul sub
39
       dy arrl w add mul dx w 2 div arrw add mul add rlineto
40
       dx arrl w add mul neg dy w 2 div arrw add mul sub
41
       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
42
       arrw dy dx neg lrl
43
       len w sub arrl sub neg dx dy lrl
44
       closepath fill } bind def
45
/cshow { 2 index 2 index moveto dup stringwidth pop
46
         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
47

	
48
gsave
49
71.0944 15 translate
50
0.434694 dup scale
51
90 rotate
52
860.856 -588.349 translate
53
%Edges:
54
gsave
55
574.035 177.301 622.149 225.748 670.264 274.195 1 0 0 2 lb
56
694.579 115.483 682.421 194.839 670.264 274.195 1 0 0 2 lb
57
280.402 10.3938 246.402 -6.60595 212.403 -23.6057 0 0 1 2 lb
58
280.402 10.3938 283.493 -18.9695 286.584 -48.3327 0 0 1 2 lb
59
212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 0 0 1 2 lb
60
286.584 -48.3327 326.765 -79.2414 366.947 -110.15 0 0 1 2 lb
61
286.584 -48.3327 278.857 -111.695 271.13 -175.058 0 0 1 2 lb
62
438.037 -88.514 417.946 -142.604 397.855 -196.694 0 0 1 2 lb
63
438.037 -88.514 402.492 -99.332 366.947 -110.15 0 0 1 2 lb
64
397.855 -196.694 382.401 -153.422 366.947 -110.15 0 0 1 2 lb
65
366.947 -110.15 319.038 -142.604 271.13 -175.058 0 0 1 2 lb
66
271.13 -175.058 274.221 -213.694 277.311 -252.33 0 0 1 2 lb
67
271.13 -175.058 238.675 -190.512 206.221 -205.967 0 0 1 2 lb
68
277.311 -252.33 241.766 -229.149 206.221 -205.967 0 0 1 2 lb
69
-840.856 -246.718 -804.351 -66.7145 -767.847 113.289 1 0 0 2 lb
70
-579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 1 2 lb
71
-579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 1 2 lb
72
-767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 1 2 lb
73
906.312 201.403 946.592 42.798 986.873 -115.807 0 0 1 2 lb
74
906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0 1 2 lb
75
986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0 1 2 lb
76
-470.779 158.605 -390.218 50.3508 -309.657 -57.9033 1 0 0 2 lb
77
422.945 521.129 208.955 541.269 -5.03507 561.41 0 0 1 2 lb
78
422.945 521.129 376.371 417.911 329.797 314.692 0 0 1 2 lb
79
422.945 521.129 474.554 276.928 526.164 32.7279 0 0 1 2 lb
80
-5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0 0 1 2 lb
81
329.797 314.692 130.912 317.209 -67.9734 319.727 0 0 1 2 lb
82
-67.9734 319.727 229.095 176.227 526.164 32.7279 0 0 1 2 lb
83
762.812 -17.6227 644.488 7.5526 526.164 32.7279 0 0 1 2 lb
84
762.812 -17.6227 746.448 -162.381 730.084 -307.139 0 0 1 2 lb
85
526.164 32.7279 470.779 -128.394 415.393 -289.516 0 0 1 2 lb
86
730.084 -307.139 572.738 -298.327 415.393 -289.516 0 0 1 2 lb
87
415.393 -289.516 173.71 -318.468 -67.9734 -347.42 1 0 0 2 lb
88
-67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0 0 1 2 lb
89
-67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0 0 1 2 lb
90
-309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0 0 1 2 lb
91
-323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0 0 1 2 lb
92
-26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 0 0 1 2 lb
93
-26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 0 0 1 2 lb
94
-26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 0 0 1 2 lb
95
-26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 0 0 1 2 lb
96
116.407 -173.66 158.808 -67.6589 201.208 38.3422 0 0 1 2 lb
97
-262.548 107.243 -137.997 120.493 -13.4452 133.743 0 0 1 2 lb
98
-262.548 107.243 -221.472 176.144 -180.397 245.045 0 0 1 2 lb
99
-13.4452 133.743 -96.9211 189.394 -180.397 245.045 0 0 1 2 lb
100
-180.397 245.045 -142.256 345.099 -132.697 451.748 0 0 1 2 lb
101
-180.397 245.045 -170.838 351.694 -132.697 451.748 0 0 1 2 lb
102
-416.25 345.746 -274.474 398.747 -132.697 451.748 0 0 1 2 lb
103
-416.25 345.746 -393.725 457.048 -371.2 568.349 0 0 1 2 lb
104
-132.697 451.748 -251.948 510.048 -371.2 568.349 0 0 1 2 lb
105
670.264 274.195 629.188 409.347 588.113 544.499 0 0 1 2 lb
106
670.264 274.195 797.466 341.771 924.667 409.347 0 0 1 2 lb
107
588.113 544.499 756.39 476.923 924.667 409.347 0 0 1 2 lb
108
-689.204 -237.261 -614.799 -102.648 -567.302 43.6423 0 0 1 2 lb
109
-689.204 -237.261 -641.707 -90.9706 -567.302 43.6423 0 0 1 2 lb
110
grestore
111
%Nodes:
112
gsave
113
-567.302 43.6423 20 0 0 0 nc
114
-689.204 -237.261 20 0 0 0 nc
115
924.667 409.347 20 0 0 1 nc
116
588.113 544.499 20 0 0 1 nc
117
670.264 274.195 20 0 0 1 nc
118
-371.2 568.349 20 1 1 0 nc
119
-132.697 451.748 20 1 1 0 nc
120
-416.25 345.746 20 1 1 0 nc
121
-180.397 245.045 20 1 1 0 nc
122
-13.4452 133.743 20 1 1 0 nc
123
-262.548 107.243 20 1 1 0 nc
124
201.208 38.3422 20 1 1 0 nc
125
116.407 -173.66 20 1 1 0 nc
126
-26.6953 -19.9585 20 1 1 0 nc
127
-539.894 -262.64 20 0 0.5 0 nc
128
-323.543 -433.964 20 0 0.5 0 nc
129
-309.657 -57.9033 20 0 0.5 0 nc
130
-67.9734 -347.42 20 0 0.5 0 nc
131
415.393 -289.516 20 0.5 0 0 nc
132
730.084 -307.139 20 0.5 0 0 nc
133
526.164 32.7279 20 0.5 0 0 nc
134
762.812 -17.6227 20 0.5 0 0 nc
135
-67.9734 319.727 20 0.5 0 0 nc
136
329.797 314.692 20 0.5 0 0 nc
137
-5.03507 561.41 20 0.5 0 0 nc
138
422.945 521.129 20 0.5 0 0 nc
139
-470.779 158.605 20 0 1 1 nc
140
986.873 -115.807 20 0.5 0 0 nc
141
906.312 201.403 20 0.5 0 0 nc
142
-767.847 113.289 20 0 1 1 nc
143
-579.033 445.603 20 0 1 1 nc
144
-840.856 -246.718 20 1 0 1 nc
145
206.221 -205.967 20 0 0 0.5 nc
146
277.311 -252.33 20 0 0 0.5 nc
147
271.13 -175.058 20 0 0 0.5 nc
148
366.947 -110.15 20 0 0 0.5 nc
149
397.855 -196.694 20 0 0 0.5 nc
150
438.037 -88.514 20 0 0 0.5 nc
151
286.584 -48.3327 20 0 0 0.5 nc
152
212.403 -23.6057 20 0 0 0.5 nc
153
280.402 10.3938 20 0 0 0.5 nc
154
694.579 115.483 20 1 0 0 nc
155
574.035 177.301 20 0 1 0 nc
156
grestore
157
grestore
158
showpage
1
%!PS-Adobe-2.0 EPSF-2.0
2
%%Creator: LEMON, graphToEps()
3
%%CreationDate: Fri Nov  4 13:47:12 2005
4
%%BoundingBox: 0 0 596 842
5
%%DocumentPaperSizes: a4
6
%%EndComments
7
/lb { setlinewidth setrgbcolor newpath moveto
8
      4 2 roll 1 index 1 index curveto stroke } bind def
9
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
10
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
11
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
12
      2 index 1 index sub 2 index 2 index add lineto
13
      2 index 1 index sub 2 index 2 index sub lineto
14
      2 index 1 index add 2 index 2 index sub lineto
15
      closepath pop pop pop} bind def
16
/di { newpath 2 index 1 index add 2 index moveto
17
      2 index             2 index 2 index add lineto
18
      2 index 1 index sub 2 index             lineto
19
      2 index             2 index 2 index sub lineto
20
      closepath pop pop pop} bind def
21
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
22
     setrgbcolor 1.1 div c fill
23
   } bind def
24
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
25
     setrgbcolor 1.1 div sq fill
26
   } bind def
27
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
28
     setrgbcolor 1.1 div di fill
29
   } bind def
30
/arrl 1 def
31
/arrw 0.3 def
32
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
33
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
34
       /w exch def /len exch def
35
       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
36
       len w sub arrl sub dx dy lrl
37
       arrw dy dx neg lrl
38
       dx arrl w add mul dy w 2 div arrw add mul sub
39
       dy arrl w add mul dx w 2 div arrw add mul add rlineto
40
       dx arrl w add mul neg dy w 2 div arrw add mul sub
41
       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
42
       arrw dy dx neg lrl
43
       len w sub arrl sub neg dx dy lrl
44
       closepath fill } bind def
45
/cshow { 2 index 2 index moveto dup stringwidth pop
46
         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
47

	
48
gsave
49
71.0944 15 translate
50
0.434694 dup scale
51
90 rotate
52
860.856 -588.349 translate
53
%Edges:
54
gsave
55
574.035 177.301 622.149 225.748 670.264 274.195 0 1 0 5 lb
56
694.579 115.483 682.421 194.839 670.264 274.195 1 0 0 5 lb
57
280.402 10.3938 246.402 -6.60595 212.403 -23.6057 1 1 0.5 5 lb
58
280.402 10.3938 283.493 -18.9695 286.584 -48.3327 1 1 0.5 5 lb
59
212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 1 1 0.5 5 lb
60
286.584 -48.3327 326.765 -79.2414 366.947 -110.15 1 0.5 1 5 lb
61
286.584 -48.3327 278.857 -111.695 271.13 -175.058 1 0.5 1 5 lb
62
438.037 -88.514 417.946 -142.604 397.855 -196.694 0.5 0.5 1 5 lb
63
438.037 -88.514 402.492 -99.332 366.947 -110.15 0.5 0.5 1 5 lb
64
397.855 -196.694 382.401 -153.422 366.947 -110.15 0.5 0.5 1 5 lb
65
366.947 -110.15 319.038 -142.604 271.13 -175.058 1 0.5 1 5 lb
66
271.13 -175.058 274.221 -213.694 277.311 -252.33 0.5 1 1 5 lb
67
271.13 -175.058 238.675 -190.512 206.221 -205.967 0.5 1 1 5 lb
68
277.311 -252.33 241.766 -229.149 206.221 -205.967 0.5 1 1 5 lb
69
-840.856 -246.718 -804.351 -66.7145 -767.847 113.289 0 0.5 0 5 lb
70
-579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 0.5 5 lb
71
-579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 0.5 5 lb
72
-767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 0.5 5 lb
73
906.312 201.403 946.592 42.798 986.873 -115.807 0 0.5 0.5 5 lb
74
906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0.5 0.5 5 lb
75
986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0.5 0.5 5 lb
76
-470.779 158.605 -390.218 50.3508 -309.657 -57.9033 0.5 0.5 0 5 lb
77
422.945 521.129 208.955 541.269 -5.03507 561.41 0.5 0 0.5 5 lb
78
422.945 521.129 376.371 417.911 329.797 314.692 0.5 0 0.5 5 lb
79
422.945 521.129 474.554 276.928 526.164 32.7279 0.5 0 0.5 5 lb
80
-5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0.5 0 0.5 5 lb
81
329.797 314.692 130.912 317.209 -67.9734 319.727 0.5 0 0.5 5 lb
82
-67.9734 319.727 229.095 176.227 526.164 32.7279 0.5 0 0.5 5 lb
83
762.812 -17.6227 644.488 7.5526 526.164 32.7279 0.5 0.5 0.5 5 lb
84
762.812 -17.6227 746.448 -162.381 730.084 -307.139 0.5 0.5 0.5 5 lb
85
526.164 32.7279 470.779 -128.394 415.393 -289.516 0.5 0.5 0.5 5 lb
86
730.084 -307.139 572.738 -298.327 415.393 -289.516 0.5 0.5 0.5 5 lb
87
415.393 -289.516 173.71 -318.468 -67.9734 -347.42 1 0.5 0.5 5 lb
88
-67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0.5 1 0.5 5 lb
89
-67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0.5 1 0.5 5 lb
90
-309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0.5 1 0.5 5 lb
91
-323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0.5 1 0.5 5 lb
92
-26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 1 1 0 5 lb
93
-26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 1 1 0 5 lb
94
-26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 1 0 1 5 lb
95
-26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 1 0 1 5 lb
96
116.407 -173.66 158.808 -67.6589 201.208 38.3422 1 1 0 5 lb
97
-262.548 107.243 -137.997 120.493 -13.4452 133.743 1 0 1 5 lb
98
-262.548 107.243 -221.472 176.144 -180.397 245.045 1 0 1 5 lb
99
-13.4452 133.743 -96.9211 189.394 -180.397 245.045 1 0 1 5 lb
100
-180.397 245.045 -140.307 344.649 -132.697 451.748 0 1 1 5 lb
101
-180.397 245.045 -172.787 352.144 -132.697 451.748 0 1 1 5 lb
102
-416.25 345.746 -274.474 398.747 -132.697 451.748 0.5 0 0 5 lb
103
-416.25 345.746 -393.725 457.048 -371.2 568.349 0.5 0 0 5 lb
104
-132.697 451.748 -251.948 510.048 -371.2 568.349 0.5 0 0 5 lb
105
670.264 274.195 629.188 409.347 588.113 544.499 0 0 1 5 lb
106
670.264 274.195 797.466 341.771 924.667 409.347 0 0 1 5 lb
107
588.113 544.499 756.39 476.923 924.667 409.347 0 0 1 5 lb
108
-689.204 -237.261 -612.964 -103.444 -567.302 43.6423 0 0 0 5 lb
109
-689.204 -237.261 -643.542 -90.1744 -567.302 43.6423 0 0 0 5 lb
110
grestore
111
%Nodes:
112
gsave
113
-567.302 43.6423 20 0 0 1 nc
114
-689.204 -237.261 20 0 0 1 nc
115
924.667 409.347 20 0 0 1 nc
116
588.113 544.499 20 0 0 1 nc
117
670.264 274.195 20 1 0 0 nc
118
-371.2 568.349 20 0 0 1 nc
119
-132.697 451.748 20 1 0 0 nc
120
-416.25 345.746 20 0 0 1 nc
121
-180.397 245.045 20 1 0 0 nc
122
-13.4452 133.743 20 0 0 1 nc
123
-262.548 107.243 20 0 0 1 nc
124
201.208 38.3422 20 0 0 1 nc
125
116.407 -173.66 20 0 0 1 nc
126
-26.6953 -19.9585 20 1 0 0 nc
127
-539.894 -262.64 20 0 0 1 nc
128
-323.543 -433.964 20 0 0 1 nc
129
-309.657 -57.9033 20 1 0 0 nc
130
-67.9734 -347.42 20 1 0 0 nc
131
415.393 -289.516 20 1 0 0 nc
132
730.084 -307.139 20 0 0 1 nc
133
526.164 32.7279 20 1 0 0 nc
134
762.812 -17.6227 20 1 0 0 nc
135
-67.9734 319.727 20 0 0 1 nc
136
329.797 314.692 20 0 0 1 nc
137
-5.03507 561.41 20 0 0 1 nc
138
422.945 521.129 20 0 0 1 nc
139
-470.779 158.605 20 1 0 0 nc
140
986.873 -115.807 20 0 0 1 nc
141
906.312 201.403 20 0 0 1 nc
142
-767.847 113.289 20 1 0 0 nc
143
-579.033 445.603 20 0 0 1 nc
144
-840.856 -246.718 20 0 0 1 nc
145
206.221 -205.967 20 0 0 1 nc
146
277.311 -252.33 20 0 0 1 nc
147
271.13 -175.058 20 1 0 0 nc
148
366.947 -110.15 20 1 0 0 nc
149
397.855 -196.694 20 0 0 1 nc
150
438.037 -88.514 20 0 0 1 nc
151
286.584 -48.3327 20 1 0 0 nc
152
212.403 -23.6057 20 0 0 1 nc
153
280.402 10.3938 20 0 0 1 nc
154
694.579 115.483 20 0 0 1 nc
155
574.035 177.301 20 0 0 1 nc
156
grestore
157
grestore
158
showpage
1
%!PS-Adobe-2.0 EPSF-2.0
2
%%Creator: LEMON, graphToEps()
3
%%CreationDate: Fri Nov  4 13:47:12 2005
4
%%BoundingBox: 0 0 596 842
5
%%DocumentPaperSizes: a4
6
%%EndComments
7
/lb { setlinewidth setrgbcolor newpath moveto
8
      4 2 roll 1 index 1 index curveto stroke } bind def
9
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
10
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
11
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
12
      2 index 1 index sub 2 index 2 index add lineto
13
      2 index 1 index sub 2 index 2 index sub lineto
14
      2 index 1 index add 2 index 2 index sub lineto
15
      closepath pop pop pop} bind def
16
/di { newpath 2 index 1 index add 2 index moveto
17
      2 index             2 index 2 index add lineto
18
      2 index 1 index sub 2 index             lineto
19
      2 index             2 index 2 index sub lineto
20
      closepath pop pop pop} bind def
21
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
22
     setrgbcolor 1.1 div c fill
23
   } bind def
24
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
25
     setrgbcolor 1.1 div sq fill
26
   } bind def
27
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
28
     setrgbcolor 1.1 div di fill
29
   } bind def
30
/arrl 10 def
31
/arrw 3 def
32
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
33
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
34
       /w exch def /len exch def
35
       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
36
       len w sub arrl sub dx dy lrl
37
       arrw dy dx neg lrl
38
       dx arrl w add mul dy w 2 div arrw add mul sub
39
       dy arrl w add mul dx w 2 div arrw add mul add rlineto
40
       dx arrl w add mul neg dy w 2 div arrw add mul sub
41
       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
42
       arrw dy dx neg lrl
43
       len w sub arrl sub neg dx dy lrl
44
       closepath fill } bind def
45
/cshow { 2 index 2 index moveto dup stringwidth pop
46
         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
47

	
48
gsave
49
77.1122 15 translate
50
0.585745 dup scale
51
90 rotate
52
695.963 -397.916 translate
53
%Edges:
54
gsave
55
2 setlinewidth 0 0 1 setrgbcolor newpath
56
218.178 27.2723 moveto
57
192.373 -40.1551 188.622 -49.9556 169.228 -100.631 curveto stroke
58
newpath 164.939 -111.838 moveto 165.492 -99.2013 lineto 172.964 -102.061 lineto closepath fill
59
2 setlinewidth 0 0 1 setrgbcolor newpath
60
44.8044 15.5841 moveto
61
119.293 20.6059 129.775 21.3125 186.25 25.1199 curveto stroke
62
newpath 198.223 25.927 moveto 186.519 21.1289 lineto 185.981 29.1108 lineto closepath fill
63
2 setlinewidth 1 0 0 setrgbcolor newpath
64
218.178 27.2723 moveto
65
285.395 -87.4449 290.763 -96.6058 348.102 -194.464 curveto stroke
66
newpath 354.169 -204.818 moveto 344.651 -196.487 lineto 351.554 -192.442 lineto closepath fill
67
2 setlinewidth 0 0 1 setrgbcolor newpath
68
157.79 -130.517 moveto
69
108.71 -67.0521 102.27 -58.7243 64.3804 -9.72954 curveto stroke
70
newpath 57.0394 -0.236898 moveto 67.5446 -7.28254 lineto 61.2162 -12.1765 lineto closepath fill
71
2 setlinewidth 1 0 0 setrgbcolor newpath
72
-105.193 -261.035 moveto
73
-35.6576 -132.801 -30.5923 -123.459 29.5506 -12.5464 curveto stroke
74
newpath 35.2708 -1.99743 moveto 33.0669 -14.4531 lineto 26.0343 -10.6397 lineto closepath fill
75
2 setlinewidth 0 0 1 setrgbcolor newpath
76
-465.576 -42.8564 moveto
77
-559.078 -25.5413 -569.47 -23.6169 -644.498 -9.72286 curveto stroke
78
newpath -656.297 -7.5378 moveto -643.77 -5.78973 lineto -645.226 -13.656 lineto closepath fill
79
2 setlinewidth 0 0 1 setrgbcolor newpath
80
-574.666 -153.893 moveto
81
-528.842 -107.252 -521.515 -99.794 -488.002 -65.683 curveto stroke
82
newpath -479.592 -57.123 moveto -485.149 -68.4863 lineto -490.856 -62.8797 lineto closepath fill
83
2 setlinewidth 1 0 0 setrgbcolor newpath
84
-490.901 120.777 moveto
85
-480.122 51.1328 -478.519 40.7713 -470.47 -11.2329 curveto stroke
86
newpath -468.635 -23.0917 moveto -474.423 -11.8447 lineto -466.517 -10.6212 lineto closepath fill
87
2 setlinewidth 0 0 1 setrgbcolor newpath
88
-675.963 -3.89604 moveto
89
-632.116 -68.8235 -626.228 -77.5422 -592.575 -127.374 curveto stroke
90
newpath -585.859 -137.319 moveto -595.89 -129.612 lineto -589.26 -125.135 lineto closepath fill
91
2 setlinewidth 0 0 1 setrgbcolor newpath
92
-490.901 120.777 moveto
93
-435.445 215.844 -430.107 224.995 -384.3 303.522 curveto stroke
94
newpath -378.253 313.887 moveto -380.845 301.507 lineto -387.755 305.537 lineto closepath fill
95
2 setlinewidth 0 0 1 setrgbcolor newpath
96
-266.879 114.933 moveto
97
-367.067 117.547 -377.642 117.822 -458.912 119.943 curveto stroke
98
newpath -470.908 120.255 moveto -458.807 123.941 lineto -459.016 115.944 lineto closepath fill
99
2 setlinewidth 0 0 1 setrgbcolor newpath
100
-368.176 331.163 moveto
101
-322.511 233.685 -318.018 224.095 -280.454 143.911 curveto stroke
102
newpath -275.364 133.044 moveto -284.076 142.214 lineto -276.832 145.608 lineto closepath fill
103
2 setlinewidth 1 0 0 setrgbcolor newpath
104
-266.879 114.933 moveto
105
-224.004 235.52 -220.448 245.52 -184.094 347.765 curveto stroke
106
newpath -180.074 359.072 moveto -180.325 346.425 lineto -187.863 349.105 lineto closepath fill
107
2 setlinewidth 0 0 1 setrgbcolor newpath
108
-251.294 -335.059 moveto
109
-189.25 -303.624 -179.902 -298.887 -133.738 -275.498 curveto stroke
110
newpath -123.034 -270.074 moveto -131.93 -279.066 lineto -135.546 -271.93 lineto closepath fill
111
2 setlinewidth 0 0 1 setrgbcolor newpath
112
-389.604 -136.361 moveto
113
-327.15 -226.083 -321.098 -234.777 -269.576 -308.795 curveto stroke
114
newpath -262.72 -318.644 moveto -272.859 -311.081 lineto -266.293 -306.51 lineto closepath fill
115
2 setlinewidth 1 0 0 setrgbcolor newpath
116
5.84406 175.322 moveto
117
-76.0754 267.926 -83.1051 275.873 -152.172 353.948 curveto stroke
118
newpath -160.122 362.936 moveto -149.176 356.598 lineto -155.168 351.298 lineto closepath fill
119
2 setlinewidth 0 0 1 setrgbcolor newpath
120
169.478 311.683 moveto
121
96.8003 251.119 88.6819 244.353 30.4273 195.808 curveto stroke
122
newpath 21.2086 188.126 moveto 27.8666 198.881 lineto 32.988 192.735 lineto closepath fill
123
2 setlinewidth 0 0 1 setrgbcolor newpath
124
342.851 111.037 moveto
125
263.766 202.563 256.831 210.589 190.4 287.47 curveto stroke
126
newpath 182.554 296.55 moveto 193.427 290.085 lineto 187.373 284.855 lineto closepath fill
127
2 setlinewidth 0 0 1 setrgbcolor newpath
128
5.84406 175.322 moveto
129
163.16 145.314 173.605 143.321 311.418 117.033 curveto stroke
130
newpath 323.205 114.784 moveto 310.668 113.104 lineto 312.167 120.962 lineto closepath fill
131
2 setlinewidth 0 0 1 setrgbcolor newpath
132
342.851 111.037 moveto
133
497.255 2.58683 505.964 -3.53033 643.932 -100.436 curveto stroke
134
newpath 653.752 -107.334 moveto 641.633 -103.71 lineto 646.231 -97.163 lineto closepath fill
135
2 setlinewidth 0 0 1 setrgbcolor newpath
136
364.28 -222.074 moveto
137
354.298 -66.9063 353.616 -56.2971 344.905 79.1029 curveto stroke
138
newpath 344.135 91.0781 moveto 348.897 79.3597 lineto 340.914 78.8461 lineto closepath fill
139
2 setlinewidth 0 0 1 setrgbcolor newpath
140
670.118 -118.829 moveto
141
528.037 -166.793 517.967 -170.192 394.599 -211.839 curveto stroke
142
newpath 383.229 -215.677 moveto 393.32 -208.049 lineto 395.878 -215.629 lineto closepath fill
143
2 setlinewidth 1 0 0 setrgbcolor newpath
144
-105.193 -261.035 moveto
145
118.401 -242.479 129.015 -241.598 332.39 -224.721 curveto stroke
146
newpath 344.348 -223.728 moveto 332.72 -228.707 lineto 332.059 -220.734 lineto closepath fill
147
2 setlinewidth 0 0 1 setrgbcolor newpath
148
-105.193 -261.035 moveto
149
-160.867 -161.176 -166.028 -151.918 -212.336 -68.858 curveto stroke
150
newpath -218.179 -58.3769 moveto -208.842 -66.9102 lineto -215.829 -70.8058 lineto closepath fill
151
2 setlinewidth 0 0 1 setrgbcolor newpath
152
-227.918 -40.9084 moveto
153
-298.35 -82.4884 -307.42 -87.8432 -362.048 -120.093 curveto stroke
154
newpath -372.381 -126.193 moveto -364.081 -116.648 lineto -360.014 -123.537 lineto closepath fill
155
grestore
156
%Nodes:
157
gsave
158
-389.604 -136.361 20 0 1 0 nc
159
-227.918 -40.9084 20 0 1 0 nc
160
-105.193 -261.035 20 0 1 0 nc
161
364.28 -222.074 20 1 1 0 nc
162
670.118 -118.829 20 1 1 0 nc
163
342.851 111.037 20 1 1 0 nc
164
5.84406 175.322 20 1 1 0 nc
165
169.478 311.683 20 1 1 0 nc
166
-173.374 377.916 20 1 0 1 nc
167
-251.294 -335.059 20 0 1 0 nc
168
-266.879 114.933 20 0 0 0 nc
169
-368.176 331.163 20 0 0 0 nc
170
-490.901 120.777 20 0 0 0 nc
171
-574.666 -153.893 20 1 0 0 nc
172
-675.963 -3.89604 20 1 0 0 nc
173
-465.576 -42.8564 20 1 0 0 nc
174
44.8044 15.5841 20 0 0 1 nc
175
157.79 -130.517 20 0 0 1 nc
176
218.178 27.2723 20 0 0 1 nc
177
grestore
178
grestore
179
showpage
Ignore white space 6 line context
1 1
SET(PACKAGE_NAME ${PROJECT_NAME})
2 2
SET(PACKAGE_VERSION ${PROJECT_VERSION})
3 3
SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
4 4
SET(abs_top_builddir ${PROJECT_BINARY_DIR})
5 5

	
6 6
CONFIGURE_FILE(
7 7
  ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
8 8
  ${PROJECT_BINARY_DIR}/doc/Doxyfile
9 9
  @ONLY)
10 10

	
11 11
IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
12 12
  FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
13 13
  IF(UNIX)
14 14
    ADD_CUSTOM_TARGET(html
15 15
      COMMAND rm -rf gen-images
16 16
      COMMAND mkdir gen-images
17
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/bipartite_matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_matching.eps
18
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/bipartite_partitions.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_partitions.eps
19
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/connected_components.eps
20
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
17 21
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
22
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
18 23
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
19 24
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
20 25
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
21 26
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
22 27
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
28
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
23 29
      COMMAND rm -rf html
24 30
      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
25 31
      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
26 32
  ELSEIF(WIN32)
27 33
    ADD_CUSTOM_TARGET(html
28 34
      COMMAND if exist gen-images rmdir /s /q gen-images
29 35
      COMMAND mkdir gen-images
36
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/bipartite_matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_matching.eps
37
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/bipartite_partitions.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_partitions.eps
38
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/connected_components.eps
39
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
40
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
41
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
30 42
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
31 43
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
32 44
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
33 45
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
34 46
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
47
      COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
35 48
      COMMAND if exist html rmdir /s /q html
36 49
      COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
37 50
      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
38 51
  ENDIF(UNIX)
39 52
  INSTALL(
40 53
    DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
41 54
    DESTINATION share/doc
42 55
    COMPONENT html_documentation)
43 56
ENDIF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
Ignore white space 6 line context
1 1
EXTRA_DIST += \
2 2
	doc/Doxyfile.in \
3 3
	doc/DoxygenLayout.xml \
4 4
	doc/coding_style.dox \
5 5
	doc/dirs.dox \
6 6
	doc/groups.dox \
7 7
	doc/lgf.dox \
8 8
	doc/license.dox \
9 9
	doc/mainpage.dox \
10 10
	doc/migration.dox \
11 11
	doc/named-param.dox \
12 12
	doc/namespaces.dox \
13 13
	doc/html \
14 14
	doc/CMakeLists.txt
15 15

	
16 16
DOC_EPS_IMAGES18 = \
17
	bipartite_matching.eps \
18
	bipartite_partitions.eps \
19
	connected_components.eps \
20
	edge_biconnected_components.eps \
17 21
	grid_graph.eps \
22
	node_biconnected_components.eps \
18 23
	nodeshape_0.eps \
19 24
	nodeshape_1.eps \
20 25
	nodeshape_2.eps \
21 26
	nodeshape_3.eps \
22
	nodeshape_4.eps
27
	nodeshape_4.eps \
28
	strongly_connected_components.eps
23 29

	
24 30
DOC_EPS_IMAGES = \
25 31
	$(DOC_EPS_IMAGES18)
26 32

	
27 33
DOC_PNG_IMAGES = \
28 34
	$(DOC_EPS_IMAGES:%.eps=doc/gen-images/%.png)
29 35

	
30 36
EXTRA_DIST += $(DOC_EPS_IMAGES:%=doc/images/%)
31 37

	
32 38
doc/html:
33 39
	$(MAKE) $(AM_MAKEFLAGS) html
34 40

	
35 41
GS_COMMAND=gs -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4
36 42

	
37 43
$(DOC_EPS_IMAGES18:%.eps=doc/gen-images/%.png): doc/gen-images/%.png: doc/images/%.eps
38 44
	-mkdir doc/gen-images
39 45
	if test ${gs_found} = yes; then \
40 46
	  $(GS_COMMAND) -sDEVICE=pngalpha -r18 -sOutputFile=$@ $<; \
41 47
	else \
42 48
	  echo; \
43 49
	  echo "Ghostscript not found."; \
44 50
	  echo; \
45 51
	  exit 1; \
46 52
	fi
47 53

	
48 54
html-local: $(DOC_PNG_IMAGES)
49 55
	if test ${doxygen_found} = yes; then \
50 56
	  cd doc; \
51 57
	  doxygen Doxyfile; \
52 58
	  cd ..; \
53 59
	else \
54 60
	  echo; \
55 61
	  echo "Doxygen not found."; \
56 62
	  echo; \
57 63
	  exit 1; \
58 64
	fi
59 65

	
60 66
clean-local:
61 67
	-rm -rf doc/html
62 68
	-rm -f doc/doxygen.log
63 69
	-rm -f $(DOC_PNG_IMAGES)
64 70
	-rm -rf doc/gen-images
65 71

	
66 72
update-external-tags:
67 73
	wget -O doc/libstdc++.tag.tmp http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/libstdc++.tag && \
68 74
	mv doc/libstdc++.tag.tmp doc/libstdc++.tag || \
69 75
	rm doc/libstdc++.tag.tmp
70 76

	
71 77
install-html-local: doc/html
72 78
	@$(NORMAL_INSTALL)
73 79
	$(mkinstalldirs) $(DESTDIR)$(htmldir)/docs
74 80
	for p in doc/html/*.{html,css,png,map,gif,tag} ; do \
75 81
	  f="`echo $$p | sed -e 's|^.*/||'`"; \
76 82
	  echo " $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/docs/$$f"; \
77 83
	  $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/docs/$$f; \
78 84
	done
79 85

	
80 86
uninstall-local:
81 87
	@$(NORMAL_UNINSTALL)
82 88
	for p in doc/html/*.{html,css,png,map,gif,tag} ; do \
83 89
	  f="`echo $$p | sed -e 's|^.*/||'`"; \
84 90
	  echo " rm -f $(DESTDIR)$(htmldir)/docs/$$f"; \
85 91
	  rm -f $(DESTDIR)$(htmldir)/docs/$$f; \
86 92
	done
87 93

	
88 94
.PHONY: update-external-tags
Ignore white space 6 line context
... ...
@@ -26,662 +26,662 @@
26 26
/**
27 27
@defgroup graphs Graph Structures
28 28
@ingroup datas
29 29
\brief Graph structures implemented in LEMON.
30 30

	
31 31
The implementation of combinatorial algorithms heavily relies on
32 32
efficient graph implementations. LEMON offers data structures which are
33 33
planned to be easily used in an experimental phase of implementation studies,
34 34
and thereafter the program code can be made efficient by small modifications.
35 35

	
36 36
The most efficient implementation of diverse applications require the
37 37
usage of different physical graph implementations. These differences
38 38
appear in the size of graph we require to handle, memory or time usage
39 39
limitations or in the set of operations through which the graph can be
40 40
accessed.  LEMON provides several physical graph structures to meet
41 41
the diverging requirements of the possible users.  In order to save on
42 42
running time or on memory usage, some structures may fail to provide
43 43
some graph features like arc/edge or node deletion.
44 44

	
45 45
Alteration of standard containers need a very limited number of
46 46
operations, these together satisfy the everyday requirements.
47 47
In the case of graph structures, different operations are needed which do
48 48
not alter the physical graph, but gives another view. If some nodes or
49 49
arcs have to be hidden or the reverse oriented graph have to be used, then
50 50
this is the case. It also may happen that in a flow implementation
51 51
the residual graph can be accessed by another algorithm, or a node-set
52 52
is to be shrunk for another algorithm.
53 53
LEMON also provides a variety of graphs for these requirements called
54 54
\ref graph_adaptors "graph adaptors". Adaptors cannot be used alone but only
55 55
in conjunction with other graph representations.
56 56

	
57 57
You are free to use the graph structure that fit your requirements
58 58
the best, most graph algorithms and auxiliary data structures can be used
59 59
with any graph structure.
60 60

	
61 61
<b>See also:</b> \ref graph_concepts "Graph Structure Concepts".
62 62
*/
63 63

	
64 64
/**
65 65
@defgroup graph_adaptors Adaptor Classes for Graphs
66 66
@ingroup graphs
67 67
\brief Adaptor classes for digraphs and graphs
68 68

	
69 69
This group contains several useful adaptor classes for digraphs and graphs.
70 70

	
71 71
The main parts of LEMON are the different graph structures, generic
72 72
graph algorithms, graph concepts, which couple them, and graph
73 73
adaptors. While the previous notions are more or less clear, the
74 74
latter one needs further explanation. Graph adaptors are graph classes
75 75
which serve for considering graph structures in different ways.
76 76

	
77 77
A short example makes this much clearer.  Suppose that we have an
78 78
instance \c g of a directed graph type, say ListDigraph and an algorithm
79 79
\code
80 80
template <typename Digraph>
81 81
int algorithm(const Digraph&);
82 82
\endcode
83 83
is needed to run on the reverse oriented graph.  It may be expensive
84 84
(in time or in memory usage) to copy \c g with the reversed
85 85
arcs.  In this case, an adaptor class is used, which (according
86 86
to LEMON \ref concepts::Digraph "digraph concepts") works as a digraph.
87 87
The adaptor uses the original digraph structure and digraph operations when
88 88
methods of the reversed oriented graph are called.  This means that the adaptor
89 89
have minor memory usage, and do not perform sophisticated algorithmic
90 90
actions.  The purpose of it is to give a tool for the cases when a
91 91
graph have to be used in a specific alteration.  If this alteration is
92 92
obtained by a usual construction like filtering the node or the arc set or
93 93
considering a new orientation, then an adaptor is worthwhile to use.
94 94
To come back to the reverse oriented graph, in this situation
95 95
\code
96 96
template<typename Digraph> class ReverseDigraph;
97 97
\endcode
98 98
template class can be used. The code looks as follows
99 99
\code
100 100
ListDigraph g;
101 101
ReverseDigraph<ListDigraph> rg(g);
102 102
int result = algorithm(rg);
103 103
\endcode
104 104
During running the algorithm, the original digraph \c g is untouched.
105 105
This techniques give rise to an elegant code, and based on stable
106 106
graph adaptors, complex algorithms can be implemented easily.
107 107

	
108 108
In flow, circulation and matching problems, the residual
109 109
graph is of particular importance. Combining an adaptor implementing
110 110
this with shortest path algorithms or minimum mean cycle algorithms,
111 111
a range of weighted and cardinality optimization algorithms can be
112 112
obtained. For other examples, the interested user is referred to the
113 113
detailed documentation of particular adaptors.
114 114

	
115 115
The behavior of graph adaptors can be very different. Some of them keep
116 116
capabilities of the original graph while in other cases this would be
117 117
meaningless. This means that the concepts that they meet depend
118 118
on the graph adaptor, and the wrapped graph.
119 119
For example, if an arc of a reversed digraph is deleted, this is carried
120 120
out by deleting the corresponding arc of the original digraph, thus the
121 121
adaptor modifies the original digraph.
122 122
However in case of a residual digraph, this operation has no sense.
123 123

	
124 124
Let us stand one more example here to simplify your work.
125 125
ReverseDigraph has constructor
126 126
\code
127 127
ReverseDigraph(Digraph& digraph);
128 128
\endcode
129 129
This means that in a situation, when a <tt>const %ListDigraph&</tt>
130 130
reference to a graph is given, then it have to be instantiated with
131 131
<tt>Digraph=const %ListDigraph</tt>.
132 132
\code
133 133
int algorithm1(const ListDigraph& g) {
134 134
  ReverseDigraph<const ListDigraph> rg(g);
135 135
  return algorithm2(rg);
136 136
}
137 137
\endcode
138 138
*/
139 139

	
140 140
/**
141 141
@defgroup semi_adaptors Semi-Adaptor Classes for Graphs
142 142
@ingroup graphs
143 143
\brief Graph types between real graphs and graph adaptors.
144 144

	
145 145
This group contains some graph types between real graphs and graph adaptors.
146 146
These classes wrap graphs to give new functionality as the adaptors do it.
147 147
On the other hand they are not light-weight structures as the adaptors.
148 148
*/
149 149

	
150 150
/**
151 151
@defgroup maps Maps
152 152
@ingroup datas
153 153
\brief Map structures implemented in LEMON.
154 154

	
155 155
This group contains the map structures implemented in LEMON.
156 156

	
157 157
LEMON provides several special purpose maps and map adaptors that e.g. combine
158 158
new maps from existing ones.
159 159

	
160 160
<b>See also:</b> \ref map_concepts "Map Concepts".
161 161
*/
162 162

	
163 163
/**
164 164
@defgroup graph_maps Graph Maps
165 165
@ingroup maps
166 166
\brief Special graph-related maps.
167 167

	
168 168
This group contains maps that are specifically designed to assign
169 169
values to the nodes and arcs/edges of graphs.
170 170

	
171 171
If you are looking for the standard graph maps (\c NodeMap, \c ArcMap,
172 172
\c EdgeMap), see the \ref graph_concepts "Graph Structure Concepts".
173 173
*/
174 174

	
175 175
/**
176 176
\defgroup map_adaptors Map Adaptors
177 177
\ingroup maps
178 178
\brief Tools to create new maps from existing ones
179 179

	
180 180
This group contains map adaptors that are used to create "implicit"
181 181
maps from other maps.
182 182

	
183 183
Most of them are \ref concepts::ReadMap "read-only maps".
184 184
They can make arithmetic and logical operations between one or two maps
185 185
(negation, shifting, addition, multiplication, logical 'and', 'or',
186 186
'not' etc.) or e.g. convert a map to another one of different Value type.
187 187

	
188 188
The typical usage of this classes is passing implicit maps to
189 189
algorithms.  If a function type algorithm is called then the function
190 190
type map adaptors can be used comfortable. For example let's see the
191 191
usage of map adaptors with the \c graphToEps() function.
192 192
\code
193 193
  Color nodeColor(int deg) {
194 194
    if (deg >= 2) {
195 195
      return Color(0.5, 0.0, 0.5);
196 196
    } else if (deg == 1) {
197 197
      return Color(1.0, 0.5, 1.0);
198 198
    } else {
199 199
      return Color(0.0, 0.0, 0.0);
200 200
    }
201 201
  }
202 202

	
203 203
  Digraph::NodeMap<int> degree_map(graph);
204 204

	
205 205
  graphToEps(graph, "graph.eps")
206 206
    .coords(coords).scaleToA4().undirected()
207 207
    .nodeColors(composeMap(functorToMap(nodeColor), degree_map))
208 208
    .run();
209 209
\endcode
210 210
The \c functorToMap() function makes an \c int to \c Color map from the
211 211
\c nodeColor() function. The \c composeMap() compose the \c degree_map
212 212
and the previously created map. The composed map is a proper function to
213 213
get the color of each node.
214 214

	
215 215
The usage with class type algorithms is little bit harder. In this
216 216
case the function type map adaptors can not be used, because the
217 217
function map adaptors give back temporary objects.
218 218
\code
219 219
  Digraph graph;
220 220

	
221 221
  typedef Digraph::ArcMap<double> DoubleArcMap;
222 222
  DoubleArcMap length(graph);
223 223
  DoubleArcMap speed(graph);
224 224

	
225 225
  typedef DivMap<DoubleArcMap, DoubleArcMap> TimeMap;
226 226
  TimeMap time(length, speed);
227 227

	
228 228
  Dijkstra<Digraph, TimeMap> dijkstra(graph, time);
229 229
  dijkstra.run(source, target);
230 230
\endcode
231 231
We have a length map and a maximum speed map on the arcs of a digraph.
232 232
The minimum time to pass the arc can be calculated as the division of
233 233
the two maps which can be done implicitly with the \c DivMap template
234 234
class. We use the implicit minimum time map as the length map of the
235 235
\c Dijkstra algorithm.
236 236
*/
237 237

	
238 238
/**
239 239
@defgroup matrices Matrices
240 240
@ingroup datas
241 241
\brief Two dimensional data storages implemented in LEMON.
242 242

	
243 243
This group contains two dimensional data storages implemented in LEMON.
244 244
*/
245 245

	
246 246
/**
247 247
@defgroup paths Path Structures
248 248
@ingroup datas
249 249
\brief %Path structures implemented in LEMON.
250 250

	
251 251
This group contains the path structures implemented in LEMON.
252 252

	
253 253
LEMON provides flexible data structures to work with paths.
254 254
All of them have similar interfaces and they can be copied easily with
255 255
assignment operators and copy constructors. This makes it easy and
256 256
efficient to have e.g. the Dijkstra algorithm to store its result in
257 257
any kind of path structure.
258 258

	
259 259
\sa lemon::concepts::Path
260 260
*/
261 261

	
262 262
/**
263 263
@defgroup auxdat Auxiliary Data Structures
264 264
@ingroup datas
265 265
\brief Auxiliary data structures implemented in LEMON.
266 266

	
267 267
This group contains some data structures implemented in LEMON in
268 268
order to make it easier to implement combinatorial algorithms.
269 269
*/
270 270

	
271 271
/**
272 272
@defgroup algs Algorithms
273 273
\brief This group contains the several algorithms
274 274
implemented in LEMON.
275 275

	
276 276
This group contains the several algorithms
277 277
implemented in LEMON.
278 278
*/
279 279

	
280 280
/**
281 281
@defgroup search Graph Search
282 282
@ingroup algs
283 283
\brief Common graph search algorithms.
284 284

	
285 285
This group contains the common graph search algorithms, namely
286 286
\e breadth-first \e search (BFS) and \e depth-first \e search (DFS).
287 287
*/
288 288

	
289 289
/**
290 290
@defgroup shortest_path Shortest Path Algorithms
291 291
@ingroup algs
292 292
\brief Algorithms for finding shortest paths.
293 293

	
294 294
This group contains the algorithms for finding shortest paths in digraphs.
295 295

	
296 296
 - \ref Dijkstra algorithm for finding shortest paths from a source node
297 297
   when all arc lengths are non-negative.
298 298
 - \ref BellmanFord "Bellman-Ford" algorithm for finding shortest paths
299 299
   from a source node when arc lenghts can be either positive or negative,
300 300
   but the digraph should not contain directed cycles with negative total
301 301
   length.
302 302
 - \ref FloydWarshall "Floyd-Warshall" and \ref Johnson "Johnson" algorithms
303 303
   for solving the \e all-pairs \e shortest \e paths \e problem when arc
304 304
   lenghts can be either positive or negative, but the digraph should
305 305
   not contain directed cycles with negative total length.
306 306
 - \ref Suurballe A successive shortest path algorithm for finding
307 307
   arc-disjoint paths between two nodes having minimum total length.
308 308
*/
309 309

	
310 310
/**
311 311
@defgroup max_flow Maximum Flow Algorithms
312 312
@ingroup algs
313 313
\brief Algorithms for finding maximum flows.
314 314

	
315 315
This group contains the algorithms for finding maximum flows and
316 316
feasible circulations.
317 317

	
318 318
The \e maximum \e flow \e problem is to find a flow of maximum value between
319 319
a single source and a single target. Formally, there is a \f$G=(V,A)\f$
320 320
digraph, a \f$cap:A\rightarrow\mathbf{R}^+_0\f$ capacity function and
321 321
\f$s, t \in V\f$ source and target nodes.
322 322
A maximum flow is an \f$f:A\rightarrow\mathbf{R}^+_0\f$ solution of the
323 323
following optimization problem.
324 324

	
325 325
\f[ \max\sum_{a\in\delta_{out}(s)}f(a) - \sum_{a\in\delta_{in}(s)}f(a) \f]
326 326
\f[ \sum_{a\in\delta_{out}(v)} f(a) = \sum_{a\in\delta_{in}(v)} f(a)
327 327
    \qquad \forall v\in V\setminus\{s,t\} \f]
328 328
\f[ 0 \leq f(a) \leq cap(a) \qquad \forall a\in A \f]
329 329

	
330 330
LEMON contains several algorithms for solving maximum flow problems:
331 331
- \ref EdmondsKarp Edmonds-Karp algorithm.
332 332
- \ref Preflow Goldberg-Tarjan's preflow push-relabel algorithm.
333 333
- \ref DinitzSleatorTarjan Dinitz's blocking flow algorithm with dynamic trees.
334 334
- \ref GoldbergTarjan Preflow push-relabel algorithm with dynamic trees.
335 335

	
336 336
In most cases the \ref Preflow "Preflow" algorithm provides the
337 337
fastest method for computing a maximum flow. All implementations
338 338
provides functions to also query the minimum cut, which is the dual
339 339
problem of the maximum flow.
340 340
*/
341 341

	
342 342
/**
343 343
@defgroup min_cost_flow Minimum Cost Flow Algorithms
344 344
@ingroup algs
345 345

	
346 346
\brief Algorithms for finding minimum cost flows and circulations.
347 347

	
348 348
This group contains the algorithms for finding minimum cost flows and
349 349
circulations.
350 350

	
351 351
The \e minimum \e cost \e flow \e problem is to find a feasible flow of
352 352
minimum total cost from a set of supply nodes to a set of demand nodes
353 353
in a network with capacity constraints and arc costs.
354 354
Formally, let \f$G=(V,A)\f$ be a digraph,
355 355
\f$lower, upper: A\rightarrow\mathbf{Z}^+_0\f$ denote the lower and
356 356
upper bounds for the flow values on the arcs,
357 357
\f$cost: A\rightarrow\mathbf{Z}^+_0\f$ denotes the cost per unit flow
358 358
on the arcs, and
359 359
\f$supply: V\rightarrow\mathbf{Z}\f$ denotes the supply/demand values
360 360
of the nodes.
361 361
A minimum cost flow is an \f$f:A\rightarrow\mathbf{R}^+_0\f$ solution of
362 362
the following optimization problem.
363 363

	
364 364
\f[ \min\sum_{a\in A} f(a) cost(a) \f]
365 365
\f[ \sum_{a\in\delta_{out}(v)} f(a) - \sum_{a\in\delta_{in}(v)} f(a) =
366 366
    supply(v) \qquad \forall v\in V \f]
367 367
\f[ lower(a) \leq f(a) \leq upper(a) \qquad \forall a\in A \f]
368 368

	
369 369
LEMON contains several algorithms for solving minimum cost flow problems:
370 370
 - \ref CycleCanceling Cycle-canceling algorithms.
371 371
 - \ref CapacityScaling Successive shortest path algorithm with optional
372 372
   capacity scaling.
373 373
 - \ref CostScaling Push-relabel and augment-relabel algorithms based on
374 374
   cost scaling.
375 375
 - \ref NetworkSimplex Primal network simplex algorithm with various
376 376
   pivot strategies.
377 377
*/
378 378

	
379 379
/**
380 380
@defgroup min_cut Minimum Cut Algorithms
381 381
@ingroup algs
382 382

	
383 383
\brief Algorithms for finding minimum cut in graphs.
384 384

	
385 385
This group contains the algorithms for finding minimum cut in graphs.
386 386

	
387 387
The \e minimum \e cut \e problem is to find a non-empty and non-complete
388 388
\f$X\f$ subset of the nodes with minimum overall capacity on
389 389
outgoing arcs. Formally, there is a \f$G=(V,A)\f$ digraph, a
390 390
\f$cap: A\rightarrow\mathbf{R}^+_0\f$ capacity function. The minimum
391 391
cut is the \f$X\f$ solution of the next optimization problem:
392 392

	
393 393
\f[ \min_{X \subset V, X\not\in \{\emptyset, V\}}
394 394
    \sum_{uv\in A, u\in X, v\not\in X}cap(uv) \f]
395 395

	
396 396
LEMON contains several algorithms related to minimum cut problems:
397 397

	
398 398
- \ref HaoOrlin "Hao-Orlin algorithm" for calculating minimum cut
399 399
  in directed graphs.
400 400
- \ref NagamochiIbaraki "Nagamochi-Ibaraki algorithm" for
401 401
  calculating minimum cut in undirected graphs.
402 402
- \ref GomoryHu "Gomory-Hu tree computation" for calculating
403 403
  all-pairs minimum cut in undirected graphs.
404 404

	
405 405
If you want to find minimum cut just between two distinict nodes,
406 406
see the \ref max_flow "maximum flow problem".
407 407
*/
408 408

	
409 409
/**
410
@defgroup graph_prop Connectivity and Other Graph Properties
410
@defgroup graph_properties Connectivity and Other Graph Properties
411 411
@ingroup algs
412 412
\brief Algorithms for discovering the graph properties
413 413

	
414 414
This group contains the algorithms for discovering the graph properties
415 415
like connectivity, bipartiteness, euler property, simplicity etc.
416 416

	
417 417
\image html edge_biconnected_components.png
418 418
\image latex edge_biconnected_components.eps "bi-edge-connected components" width=\textwidth
419 419
*/
420 420

	
421 421
/**
422 422
@defgroup planar Planarity Embedding and Drawing
423 423
@ingroup algs
424 424
\brief Algorithms for planarity checking, embedding and drawing
425 425

	
426 426
This group contains the algorithms for planarity checking,
427 427
embedding and drawing.
428 428

	
429 429
\image html planar.png
430 430
\image latex planar.eps "Plane graph" width=\textwidth
431 431
*/
432 432

	
433 433
/**
434 434
@defgroup matching Matching Algorithms
435 435
@ingroup algs
436 436
\brief Algorithms for finding matchings in graphs and bipartite graphs.
437 437

	
438 438
This group contains algorithm objects and functions to calculate
439 439
matchings in graphs and bipartite graphs. The general matching problem is
440 440
finding a subset of the arcs which does not shares common endpoints.
441 441

	
442 442
There are several different algorithms for calculate matchings in
443 443
graphs.  The matching problems in bipartite graphs are generally
444 444
easier than in general graphs. The goal of the matching optimization
445 445
can be finding maximum cardinality, maximum weight or minimum cost
446 446
matching. The search can be constrained to find perfect or
447 447
maximum cardinality matching.
448 448

	
449 449
The matching algorithms implemented in LEMON:
450 450
- \ref MaxBipartiteMatching Hopcroft-Karp augmenting path algorithm
451 451
  for calculating maximum cardinality matching in bipartite graphs.
452 452
- \ref PrBipartiteMatching Push-relabel algorithm
453 453
  for calculating maximum cardinality matching in bipartite graphs.
454 454
- \ref MaxWeightedBipartiteMatching
455 455
  Successive shortest path algorithm for calculating maximum weighted
456 456
  matching and maximum weighted bipartite matching in bipartite graphs.
457 457
- \ref MinCostMaxBipartiteMatching
458 458
  Successive shortest path algorithm for calculating minimum cost maximum
459 459
  matching in bipartite graphs.
460 460
- \ref MaxMatching Edmond's blossom shrinking algorithm for calculating
461 461
  maximum cardinality matching in general graphs.
462 462
- \ref MaxWeightedMatching Edmond's blossom shrinking algorithm for calculating
463 463
  maximum weighted matching in general graphs.
464 464
- \ref MaxWeightedPerfectMatching
465 465
  Edmond's blossom shrinking algorithm for calculating maximum weighted
466 466
  perfect matching in general graphs.
467 467

	
468 468
\image html bipartite_matching.png
469 469
\image latex bipartite_matching.eps "Bipartite Matching" width=\textwidth
470 470
*/
471 471

	
472 472
/**
473 473
@defgroup spantree Minimum Spanning Tree Algorithms
474 474
@ingroup algs
475 475
\brief Algorithms for finding a minimum cost spanning tree in a graph.
476 476

	
477 477
This group contains the algorithms for finding a minimum cost spanning
478 478
tree in a graph.
479 479
*/
480 480

	
481 481
/**
482 482
@defgroup auxalg Auxiliary Algorithms
483 483
@ingroup algs
484 484
\brief Auxiliary algorithms implemented in LEMON.
485 485

	
486 486
This group contains some algorithms implemented in LEMON
487 487
in order to make it easier to implement complex algorithms.
488 488
*/
489 489

	
490 490
/**
491 491
@defgroup approx Approximation Algorithms
492 492
@ingroup algs
493 493
\brief Approximation algorithms.
494 494

	
495 495
This group contains the approximation and heuristic algorithms
496 496
implemented in LEMON.
497 497
*/
498 498

	
499 499
/**
500 500
@defgroup gen_opt_group General Optimization Tools
501 501
\brief This group contains some general optimization frameworks
502 502
implemented in LEMON.
503 503

	
504 504
This group contains some general optimization frameworks
505 505
implemented in LEMON.
506 506
*/
507 507

	
508 508
/**
509 509
@defgroup lp_group Lp and Mip Solvers
510 510
@ingroup gen_opt_group
511 511
\brief Lp and Mip solver interfaces for LEMON.
512 512

	
513 513
This group contains Lp and Mip solver interfaces for LEMON. The
514 514
various LP solvers could be used in the same manner with this
515 515
interface.
516 516
*/
517 517

	
518 518
/**
519 519
@defgroup lp_utils Tools for Lp and Mip Solvers
520 520
@ingroup lp_group
521 521
\brief Helper tools to the Lp and Mip solvers.
522 522

	
523 523
This group adds some helper tools to general optimization framework
524 524
implemented in LEMON.
525 525
*/
526 526

	
527 527
/**
528 528
@defgroup metah Metaheuristics
529 529
@ingroup gen_opt_group
530 530
\brief Metaheuristics for LEMON library.
531 531

	
532 532
This group contains some metaheuristic optimization tools.
533 533
*/
534 534

	
535 535
/**
536 536
@defgroup utils Tools and Utilities
537 537
\brief Tools and utilities for programming in LEMON
538 538

	
539 539
Tools and utilities for programming in LEMON.
540 540
*/
541 541

	
542 542
/**
543 543
@defgroup gutils Basic Graph Utilities
544 544
@ingroup utils
545 545
\brief Simple basic graph utilities.
546 546

	
547 547
This group contains some simple basic graph utilities.
548 548
*/
549 549

	
550 550
/**
551 551
@defgroup misc Miscellaneous Tools
552 552
@ingroup utils
553 553
\brief Tools for development, debugging and testing.
554 554

	
555 555
This group contains several useful tools for development,
556 556
debugging and testing.
557 557
*/
558 558

	
559 559
/**
560 560
@defgroup timecount Time Measuring and Counting
561 561
@ingroup misc
562 562
\brief Simple tools for measuring the performance of algorithms.
563 563

	
564 564
This group contains simple tools for measuring the performance
565 565
of algorithms.
566 566
*/
567 567

	
568 568
/**
569 569
@defgroup exceptions Exceptions
570 570
@ingroup utils
571 571
\brief Exceptions defined in LEMON.
572 572

	
573 573
This group contains the exceptions defined in LEMON.
574 574
*/
575 575

	
576 576
/**
577 577
@defgroup io_group Input-Output
578 578
\brief Graph Input-Output methods
579 579

	
580 580
This group contains the tools for importing and exporting graphs
581 581
and graph related data. Now it supports the \ref lgf-format
582 582
"LEMON Graph Format", the \c DIMACS format and the encapsulated
583 583
postscript (EPS) format.
584 584
*/
585 585

	
586 586
/**
587 587
@defgroup lemon_io LEMON Graph Format
588 588
@ingroup io_group
589 589
\brief Reading and writing LEMON Graph Format.
590 590

	
591 591
This group contains methods for reading and writing
592 592
\ref lgf-format "LEMON Graph Format".
593 593
*/
594 594

	
595 595
/**
596 596
@defgroup eps_io Postscript Exporting
597 597
@ingroup io_group
598 598
\brief General \c EPS drawer and graph exporter
599 599

	
600 600
This group contains general \c EPS drawing methods and special
601 601
graph exporting tools.
602 602
*/
603 603

	
604 604
/**
605 605
@defgroup dimacs_group DIMACS format
606 606
@ingroup io_group
607 607
\brief Read and write files in DIMACS format
608 608

	
609 609
Tools to read a digraph from or write it to a file in DIMACS format data.
610 610
*/
611 611

	
612 612
/**
613 613
@defgroup nauty_group NAUTY Format
614 614
@ingroup io_group
615 615
\brief Read \e Nauty format
616 616

	
617 617
Tool to read graphs from \e Nauty format data.
618 618
*/
619 619

	
620 620
/**
621 621
@defgroup concept Concepts
622 622
\brief Skeleton classes and concept checking classes
623 623

	
624 624
This group contains the data/algorithm skeletons and concept checking
625 625
classes implemented in LEMON.
626 626

	
627 627
The purpose of the classes in this group is fourfold.
628 628

	
629 629
- These classes contain the documentations of the %concepts. In order
630 630
  to avoid document multiplications, an implementation of a concept
631 631
  simply refers to the corresponding concept class.
632 632

	
633 633
- These classes declare every functions, <tt>typedef</tt>s etc. an
634 634
  implementation of the %concepts should provide, however completely
635 635
  without implementations and real data structures behind the
636 636
  interface. On the other hand they should provide nothing else. All
637 637
  the algorithms working on a data structure meeting a certain concept
638 638
  should compile with these classes. (Though it will not run properly,
639 639
  of course.) In this way it is easily to check if an algorithm
640 640
  doesn't use any extra feature of a certain implementation.
641 641

	
642 642
- The concept descriptor classes also provide a <em>checker class</em>
643 643
  that makes it possible to check whether a certain implementation of a
644 644
  concept indeed provides all the required features.
645 645

	
646 646
- Finally, They can serve as a skeleton of a new implementation of a concept.
647 647
*/
648 648

	
649 649
/**
650 650
@defgroup graph_concepts Graph Structure Concepts
651 651
@ingroup concept
652 652
\brief Skeleton and concept checking classes for graph structures
653 653

	
654 654
This group contains the skeletons and concept checking classes of LEMON's
655 655
graph structures and helper classes used to implement these.
656 656
*/
657 657

	
658 658
/**
659 659
@defgroup map_concepts Map Concepts
660 660
@ingroup concept
661 661
\brief Skeleton and concept checking classes for maps
662 662

	
663 663
This group contains the skeletons and concept checking classes of maps.
664 664
*/
665 665

	
666 666
/**
667 667
\anchor demoprograms
668 668

	
669 669
@defgroup demos Demo Programs
670 670

	
671 671
Some demo programs are listed here. Their full source codes can be found in
672 672
the \c demo subdirectory of the source tree.
673 673

	
674 674
In order to compile them, use the <tt>make demo</tt> or the
675 675
<tt>make check</tt> commands.
676 676
*/
677 677

	
678 678
/**
679 679
@defgroup tools Standalone Utility Applications
680 680

	
681 681
Some utility applications are listed here.
682 682

	
683 683
The standard compilation procedure (<tt>./configure;make</tt>) will compile
684 684
them, as well.
685 685
*/
686 686

	
687 687
}
Ignore white space 768 line context
1 1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3 3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
5 5
 * Copyright (C) 2003-2009
6 6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
8 8
 *
9 9
 * Permission to use, modify and distribute this software is granted
10 10
 * provided that this copyright notice appears in all copies. For
11 11
 * precise terms see the accompanying LICENSE file.
12 12
 *
13 13
 * This software is provided "AS IS" with no warranty of any kind,
14 14
 * express or implied, and with no claim as to its suitability for any
15 15
 * purpose.
16 16
 *
17 17
 */
18 18

	
19 19
#ifndef LEMON_CONNECTIVITY_H
20 20
#define LEMON_CONNECTIVITY_H
21 21

	
22 22
#include <lemon/dfs.h>
23 23
#include <lemon/bfs.h>
24 24
#include <lemon/core.h>
25 25
#include <lemon/maps.h>
26 26
#include <lemon/adaptors.h>
27 27

	
28 28
#include <lemon/concepts/digraph.h>
29 29
#include <lemon/concepts/graph.h>
30 30
#include <lemon/concept_check.h>
31 31

	
32 32
#include <stack>
33 33
#include <functional>
34 34

	
35
/// \ingroup connectivity
35
/// \ingroup graph_properties
36 36
/// \file
37 37
/// \brief Connectivity algorithms
38 38
///
39 39
/// Connectivity algorithms
40 40

	
41 41
namespace lemon {
42 42

	
43
  /// \ingroup connectivity
43
  /// \ingroup graph_properties
44 44
  ///
45 45
  /// \brief Check whether the given undirected graph is connected.
46 46
  ///
47 47
  /// Check whether the given undirected graph is connected.
48 48
  /// \param graph The undirected graph.
49 49
  /// \return \c true when there is path between any two nodes in the graph.
50 50
  /// \note By definition, the empty graph is connected.
51 51
  template <typename Graph>
52 52
  bool connected(const Graph& graph) {
53 53
    checkConcept<concepts::Graph, Graph>();
54 54
    typedef typename Graph::NodeIt NodeIt;
55 55
    if (NodeIt(graph) == INVALID) return true;
56 56
    Dfs<Graph> dfs(graph);
57 57
    dfs.run(NodeIt(graph));
58 58
    for (NodeIt it(graph); it != INVALID; ++it) {
59 59
      if (!dfs.reached(it)) {
60 60
        return false;
61 61
      }
62 62
    }
63 63
    return true;
64 64
  }
65 65

	
66
  /// \ingroup connectivity
66
  /// \ingroup graph_properties
67 67
  ///
68 68
  /// \brief Count the number of connected components of an undirected graph
69 69
  ///
70 70
  /// Count the number of connected components of an undirected graph
71 71
  ///
72 72
  /// \param graph The graph. It must be undirected.
73 73
  /// \return The number of components
74 74
  /// \note By definition, the empty graph consists
75 75
  /// of zero connected components.
76 76
  template <typename Graph>
77 77
  int countConnectedComponents(const Graph &graph) {
78 78
    checkConcept<concepts::Graph, Graph>();
79 79
    typedef typename Graph::Node Node;
80 80
    typedef typename Graph::Arc Arc;
81 81

	
82 82
    typedef NullMap<Node, Arc> PredMap;
83 83
    typedef NullMap<Node, int> DistMap;
84 84

	
85 85
    int compNum = 0;
86 86
    typename Bfs<Graph>::
87 87
      template SetPredMap<PredMap>::
88 88
      template SetDistMap<DistMap>::
89 89
      Create bfs(graph);
90 90

	
91 91
    PredMap predMap;
92 92
    bfs.predMap(predMap);
93 93

	
94 94
    DistMap distMap;
95 95
    bfs.distMap(distMap);
96 96

	
97 97
    bfs.init();
98 98
    for(typename Graph::NodeIt n(graph); n != INVALID; ++n) {
99 99
      if (!bfs.reached(n)) {
100 100
        bfs.addSource(n);
101 101
        bfs.start();
102 102
        ++compNum;
103 103
      }
104 104
    }
105 105
    return compNum;
106 106
  }
107 107

	
108
  /// \ingroup connectivity
108
  /// \ingroup graph_properties
109 109
  ///
110 110
  /// \brief Find the connected components of an undirected graph
111 111
  ///
112 112
  /// Find the connected components of an undirected graph.
113 113
  ///
114
  /// \image html connected_components.png
115
  /// \image latex connected_components.eps "Connected components" width=\textwidth
116
  ///
114 117
  /// \param graph The graph. It must be undirected.
115 118
  /// \retval compMap A writable node map. The values will be set from 0 to
116 119
  /// the number of the connected components minus one. Each values of the map
117 120
  /// will be set exactly once, the values of a certain component will be
118 121
  /// set continuously.
119 122
  /// \return The number of components
120
  ///
121 123
  template <class Graph, class NodeMap>
122 124
  int connectedComponents(const Graph &graph, NodeMap &compMap) {
123 125
    checkConcept<concepts::Graph, Graph>();
124 126
    typedef typename Graph::Node Node;
125 127
    typedef typename Graph::Arc Arc;
126 128
    checkConcept<concepts::WriteMap<Node, int>, NodeMap>();
127 129

	
128 130
    typedef NullMap<Node, Arc> PredMap;
129 131
    typedef NullMap<Node, int> DistMap;
130 132

	
131 133
    int compNum = 0;
132 134
    typename Bfs<Graph>::
133 135
      template SetPredMap<PredMap>::
134 136
      template SetDistMap<DistMap>::
135 137
      Create bfs(graph);
136 138

	
137 139
    PredMap predMap;
138 140
    bfs.predMap(predMap);
139 141

	
140 142
    DistMap distMap;
141 143
    bfs.distMap(distMap);
142 144

	
143 145
    bfs.init();
144 146
    for(typename Graph::NodeIt n(graph); n != INVALID; ++n) {
145 147
      if(!bfs.reached(n)) {
146 148
        bfs.addSource(n);
147 149
        while (!bfs.emptyQueue()) {
148 150
          compMap.set(bfs.nextNode(), compNum);
149 151
          bfs.processNextNode();
150 152
        }
151 153
        ++compNum;
152 154
      }
153 155
    }
154 156
    return compNum;
155 157
  }
156 158

	
157 159
  namespace _connectivity_bits {
158 160

	
159 161
    template <typename Digraph, typename Iterator >
160 162
    struct LeaveOrderVisitor : public DfsVisitor<Digraph> {
161 163
    public:
162 164
      typedef typename Digraph::Node Node;
163 165
      LeaveOrderVisitor(Iterator it) : _it(it) {}
164 166

	
165 167
      void leave(const Node& node) {
166 168
        *(_it++) = node;
167 169
      }
168 170

	
169 171
    private:
170 172
      Iterator _it;
171 173
    };
172 174

	
173 175
    template <typename Digraph, typename Map>
174 176
    struct FillMapVisitor : public DfsVisitor<Digraph> {
175 177
    public:
176 178
      typedef typename Digraph::Node Node;
177 179
      typedef typename Map::Value Value;
178 180

	
179 181
      FillMapVisitor(Map& map, Value& value)
180 182
        : _map(map), _value(value) {}
181 183

	
182 184
      void reach(const Node& node) {
183 185
        _map.set(node, _value);
184 186
      }
185 187
    private:
186 188
      Map& _map;
187 189
      Value& _value;
188 190
    };
189 191

	
190 192
    template <typename Digraph, typename ArcMap>
191 193
    struct StronglyConnectedCutArcsVisitor : public DfsVisitor<Digraph> {
192 194
    public:
193 195
      typedef typename Digraph::Node Node;
194 196
      typedef typename Digraph::Arc Arc;
195 197

	
196 198
      StronglyConnectedCutArcsVisitor(const Digraph& digraph,
197 199
                                      ArcMap& cutMap,
198 200
                                      int& cutNum)
199 201
        : _digraph(digraph), _cutMap(cutMap), _cutNum(cutNum),
200 202
          _compMap(digraph, -1), _num(-1) {
201 203
      }
202 204

	
203 205
      void start(const Node&) {
204 206
        ++_num;
205 207
      }
206 208

	
207 209
      void reach(const Node& node) {
208 210
        _compMap.set(node, _num);
209 211
      }
210 212

	
211 213
      void examine(const Arc& arc) {
212 214
         if (_compMap[_digraph.source(arc)] !=
213 215
             _compMap[_digraph.target(arc)]) {
214 216
           _cutMap.set(arc, true);
215 217
           ++_cutNum;
216 218
         }
217 219
      }
218 220
    private:
219 221
      const Digraph& _digraph;
220 222
      ArcMap& _cutMap;
221 223
      int& _cutNum;
222 224

	
223 225
      typename Digraph::template NodeMap<int> _compMap;
224 226
      int _num;
225 227
    };
226 228

	
227 229
  }
228 230

	
229 231

	
230
  /// \ingroup connectivity
232
  /// \ingroup graph_properties
231 233
  ///
232 234
  /// \brief Check whether the given directed graph is strongly connected.
233 235
  ///
234 236
  /// Check whether the given directed graph is strongly connected. The
235 237
  /// graph is strongly connected when any two nodes of the graph are
236 238
  /// connected with directed paths in both direction.
237 239
  /// \return \c false when the graph is not strongly connected.
238 240
  /// \see connected
239 241
  ///
240 242
  /// \note By definition, the empty graph is strongly connected.
241 243
  template <typename Digraph>
242 244
  bool stronglyConnected(const Digraph& digraph) {
243 245
    checkConcept<concepts::Digraph, Digraph>();
244 246

	
245 247
    typedef typename Digraph::Node Node;
246 248
    typedef typename Digraph::NodeIt NodeIt;
247 249

	
248 250
    typename Digraph::Node source = NodeIt(digraph);
249 251
    if (source == INVALID) return true;
250 252

	
251 253
    using namespace _connectivity_bits;
252 254

	
253 255
    typedef DfsVisitor<Digraph> Visitor;
254 256
    Visitor visitor;
255 257

	
256 258
    DfsVisit<Digraph, Visitor> dfs(digraph, visitor);
257 259
    dfs.init();
258 260
    dfs.addSource(source);
259 261
    dfs.start();
260 262

	
261 263
    for (NodeIt it(digraph); it != INVALID; ++it) {
262 264
      if (!dfs.reached(it)) {
263 265
        return false;
264 266
      }
265 267
    }
266 268

	
267 269
    typedef ReverseDigraph<const Digraph> RDigraph;
268 270
    typedef typename RDigraph::NodeIt RNodeIt;
269 271
    RDigraph rdigraph(digraph);
270 272

	
271 273
    typedef DfsVisitor<Digraph> RVisitor;
272 274
    RVisitor rvisitor;
273 275

	
274 276
    DfsVisit<RDigraph, RVisitor> rdfs(rdigraph, rvisitor);
275 277
    rdfs.init();
276 278
    rdfs.addSource(source);
277 279
    rdfs.start();
278 280

	
279 281
    for (RNodeIt it(rdigraph); it != INVALID; ++it) {
280 282
      if (!rdfs.reached(it)) {
281 283
        return false;
282 284
      }
283 285
    }
284 286

	
285 287
    return true;
286 288
  }
287 289

	
288
  /// \ingroup connectivity
290
  /// \ingroup graph_properties
289 291
  ///
290 292
  /// \brief Count the strongly connected components of a directed graph
291 293
  ///
292 294
  /// Count the strongly connected components of a directed graph.
293 295
  /// The strongly connected components are the classes of an
294 296
  /// equivalence relation on the nodes of the graph. Two nodes are in
295 297
  /// the same class if they are connected with directed paths in both
296 298
  /// direction.
297 299
  ///
298 300
  /// \param digraph The graph.
299 301
  /// \return The number of components
300 302
  /// \note By definition, the empty graph has zero
301 303
  /// strongly connected components.
302 304
  template <typename Digraph>
303 305
  int countStronglyConnectedComponents(const Digraph& digraph) {
304 306
    checkConcept<concepts::Digraph, Digraph>();
305 307

	
306 308
    using namespace _connectivity_bits;
307 309

	
308 310
    typedef typename Digraph::Node Node;
309 311
    typedef typename Digraph::Arc Arc;
310 312
    typedef typename Digraph::NodeIt NodeIt;
311 313
    typedef typename Digraph::ArcIt ArcIt;
312 314

	
313 315
    typedef std::vector<Node> Container;
314 316
    typedef typename Container::iterator Iterator;
315 317

	
316 318
    Container nodes(countNodes(digraph));
317 319
    typedef LeaveOrderVisitor<Digraph, Iterator> Visitor;
318 320
    Visitor visitor(nodes.begin());
319 321

	
320 322
    DfsVisit<Digraph, Visitor> dfs(digraph, visitor);
321 323
    dfs.init();
322 324
    for (NodeIt it(digraph); it != INVALID; ++it) {
323 325
      if (!dfs.reached(it)) {
324 326
        dfs.addSource(it);
325 327
        dfs.start();
326 328
      }
327 329
    }
328 330

	
329 331
    typedef typename Container::reverse_iterator RIterator;
330 332
    typedef ReverseDigraph<const Digraph> RDigraph;
331 333

	
332 334
    RDigraph rdigraph(digraph);
333 335

	
334 336
    typedef DfsVisitor<Digraph> RVisitor;
335 337
    RVisitor rvisitor;
336 338

	
337 339
    DfsVisit<RDigraph, RVisitor> rdfs(rdigraph, rvisitor);
338 340

	
339 341
    int compNum = 0;
340 342

	
341 343
    rdfs.init();
342 344
    for (RIterator it = nodes.rbegin(); it != nodes.rend(); ++it) {
343 345
      if (!rdfs.reached(*it)) {
344 346
        rdfs.addSource(*it);
345 347
        rdfs.start();
346 348
        ++compNum;
347 349
      }
348 350
    }
349 351
    return compNum;
350 352
  }
351 353

	
352
  /// \ingroup connectivity
354
  /// \ingroup graph_properties
353 355
  ///
354 356
  /// \brief Find the strongly connected components of a directed graph
355 357
  ///
356 358
  /// Find the strongly connected components of a directed graph.  The
357 359
  /// strongly connected components are the classes of an equivalence
358 360
  /// relation on the nodes of the graph. Two nodes are in
359 361
  /// relationship when there are directed paths between them in both
360 362
  /// direction. In addition, the numbering of components will satisfy
361 363
  /// that there is no arc going from a higher numbered component to
362 364
  /// a lower.
363 365
  ///
366
  /// \image html strongly_connected_components.png
367
  /// \image latex strongly_connected_components.eps "Strongly connected components" width=\textwidth
368
  ///
364 369
  /// \param digraph The digraph.
365 370
  /// \retval compMap A writable node map. The values will be set from 0 to
366 371
  /// the number of the strongly connected components minus one. Each value
367 372
  /// of the map will be set exactly once, the values of a certain component
368 373
  /// will be set continuously.
369 374
  /// \return The number of components
370
  ///
371 375
  template <typename Digraph, typename NodeMap>
372 376
  int stronglyConnectedComponents(const Digraph& digraph, NodeMap& compMap) {
373 377
    checkConcept<concepts::Digraph, Digraph>();
374 378
    typedef typename Digraph::Node Node;
375 379
    typedef typename Digraph::NodeIt NodeIt;
376 380
    checkConcept<concepts::WriteMap<Node, int>, NodeMap>();
377 381

	
378 382
    using namespace _connectivity_bits;
379 383

	
380 384
    typedef std::vector<Node> Container;
381 385
    typedef typename Container::iterator Iterator;
382 386

	
383 387
    Container nodes(countNodes(digraph));
384 388
    typedef LeaveOrderVisitor<Digraph, Iterator> Visitor;
385 389
    Visitor visitor(nodes.begin());
386 390

	
387 391
    DfsVisit<Digraph, Visitor> dfs(digraph, visitor);
388 392
    dfs.init();
389 393
    for (NodeIt it(digraph); it != INVALID; ++it) {
390 394
      if (!dfs.reached(it)) {
391 395
        dfs.addSource(it);
392 396
        dfs.start();
393 397
      }
394 398
    }
395 399

	
396 400
    typedef typename Container::reverse_iterator RIterator;
397 401
    typedef ReverseDigraph<const Digraph> RDigraph;
398 402

	
399 403
    RDigraph rdigraph(digraph);
400 404

	
401 405
    int compNum = 0;
402 406

	
403 407
    typedef FillMapVisitor<RDigraph, NodeMap> RVisitor;
404 408
    RVisitor rvisitor(compMap, compNum);
405 409

	
406 410
    DfsVisit<RDigraph, RVisitor> rdfs(rdigraph, rvisitor);
407 411

	
408 412
    rdfs.init();
409 413
    for (RIterator it = nodes.rbegin(); it != nodes.rend(); ++it) {
410 414
      if (!rdfs.reached(*it)) {
411 415
        rdfs.addSource(*it);
412 416
        rdfs.start();
413 417
        ++compNum;
414 418
      }
415 419
    }
416 420
    return compNum;
417 421
  }
418 422

	
419
  /// \ingroup connectivity
423
  /// \ingroup graph_properties
420 424
  ///
421 425
  /// \brief Find the cut arcs of the strongly connected components.
422 426
  ///
423 427
  /// Find the cut arcs of the strongly connected components.
424 428
  /// The strongly connected components are the classes of an equivalence
425 429
  /// relation on the nodes of the graph. Two nodes are in relationship
426 430
  /// when there are directed paths between them in both direction.
427 431
  /// The strongly connected components are separated by the cut arcs.
428 432
  ///
429 433
  /// \param graph The graph.
430 434
  /// \retval cutMap A writable node map. The values will be set true when the
431 435
  /// arc is a cut arc.
432 436
  ///
433 437
  /// \return The number of cut arcs
434 438
  template <typename Digraph, typename ArcMap>
435 439
  int stronglyConnectedCutArcs(const Digraph& graph, ArcMap& cutMap) {
436 440
    checkConcept<concepts::Digraph, Digraph>();
437 441
    typedef typename Digraph::Node Node;
438 442
    typedef typename Digraph::Arc Arc;
439 443
    typedef typename Digraph::NodeIt NodeIt;
440 444
    checkConcept<concepts::WriteMap<Arc, bool>, ArcMap>();
441 445

	
442 446
    using namespace _connectivity_bits;
443 447

	
444 448
    typedef std::vector<Node> Container;
445 449
    typedef typename Container::iterator Iterator;
446 450

	
447 451
    Container nodes(countNodes(graph));
448 452
    typedef LeaveOrderVisitor<Digraph, Iterator> Visitor;
449 453
    Visitor visitor(nodes.begin());
450 454

	
451 455
    DfsVisit<Digraph, Visitor> dfs(graph, visitor);
452 456
    dfs.init();
453 457
    for (NodeIt it(graph); it != INVALID; ++it) {
454 458
      if (!dfs.reached(it)) {
455 459
        dfs.addSource(it);
456 460
        dfs.start();
457 461
      }
458 462
    }
459 463

	
460 464
    typedef typename Container::reverse_iterator RIterator;
461 465
    typedef ReverseDigraph<const Digraph> RDigraph;
462 466

	
463 467
    RDigraph rgraph(graph);
464 468

	
465 469
    int cutNum = 0;
466 470

	
467 471
    typedef StronglyConnectedCutArcsVisitor<RDigraph, ArcMap> RVisitor;
468 472
    RVisitor rvisitor(rgraph, cutMap, cutNum);
469 473

	
470 474
    DfsVisit<RDigraph, RVisitor> rdfs(rgraph, rvisitor);
471 475

	
472 476
    rdfs.init();
473 477
    for (RIterator it = nodes.rbegin(); it != nodes.rend(); ++it) {
474 478
      if (!rdfs.reached(*it)) {
475 479
        rdfs.addSource(*it);
476 480
        rdfs.start();
477 481
      }
478 482
    }
479 483
    return cutNum;
480 484
  }
481 485

	
482 486
  namespace _connectivity_bits {
483 487

	
484 488
    template <typename Digraph>
485 489
    class CountBiNodeConnectedComponentsVisitor : public DfsVisitor<Digraph> {
486 490
    public:
487 491
      typedef typename Digraph::Node Node;
488 492
      typedef typename Digraph::Arc Arc;
489 493
      typedef typename Digraph::Edge Edge;
490 494

	
491 495
      CountBiNodeConnectedComponentsVisitor(const Digraph& graph, int &compNum)
492 496
        : _graph(graph), _compNum(compNum),
493 497
          _numMap(graph), _retMap(graph), _predMap(graph), _num(0) {}
494 498

	
495 499
      void start(const Node& node) {
496 500
        _predMap.set(node, INVALID);
497 501
      }
498 502

	
499 503
      void reach(const Node& node) {
500 504
        _numMap.set(node, _num);
501 505
        _retMap.set(node, _num);
502 506
        ++_num;
503 507
      }
504 508

	
505 509
      void discover(const Arc& edge) {
506 510
        _predMap.set(_graph.target(edge), _graph.source(edge));
507 511
      }
508 512

	
509 513
      void examine(const Arc& edge) {
510 514
        if (_graph.source(edge) == _graph.target(edge) &&
511 515
            _graph.direction(edge)) {
512 516
          ++_compNum;
513 517
          return;
514 518
        }
515 519
        if (_predMap[_graph.source(edge)] == _graph.target(edge)) {
516 520
          return;
517 521
        }
518 522
        if (_retMap[_graph.source(edge)] > _numMap[_graph.target(edge)]) {
519 523
          _retMap.set(_graph.source(edge), _numMap[_graph.target(edge)]);
520 524
        }
521 525
      }
522 526

	
523 527
      void backtrack(const Arc& edge) {
524 528
        if (_retMap[_graph.source(edge)] > _retMap[_graph.target(edge)]) {
525 529
          _retMap.set(_graph.source(edge), _retMap[_graph.target(edge)]);
526 530
        }
527 531
        if (_numMap[_graph.source(edge)] <= _retMap[_graph.target(edge)]) {
528 532
          ++_compNum;
529 533
        }
530 534
      }
531 535

	
532 536
    private:
533 537
      const Digraph& _graph;
534 538
      int& _compNum;
535 539

	
536 540
      typename Digraph::template NodeMap<int> _numMap;
537 541
      typename Digraph::template NodeMap<int> _retMap;
538 542
      typename Digraph::template NodeMap<Node> _predMap;
539 543
      int _num;
540 544
    };
541 545

	
542 546
    template <typename Digraph, typename ArcMap>
543 547
    class BiNodeConnectedComponentsVisitor : public DfsVisitor<Digraph> {
544 548
    public:
545 549
      typedef typename Digraph::Node Node;
546 550
      typedef typename Digraph::Arc Arc;
547 551
      typedef typename Digraph::Edge Edge;
548 552

	
549 553
      BiNodeConnectedComponentsVisitor(const Digraph& graph,
550 554
                                       ArcMap& compMap, int &compNum)
551 555
        : _graph(graph), _compMap(compMap), _compNum(compNum),
552 556
          _numMap(graph), _retMap(graph), _predMap(graph), _num(0) {}
553 557

	
554 558
      void start(const Node& node) {
555 559
        _predMap.set(node, INVALID);
556 560
      }
557 561

	
558 562
      void reach(const Node& node) {
559 563
        _numMap.set(node, _num);
560 564
        _retMap.set(node, _num);
561 565
        ++_num;
562 566
      }
563 567

	
564 568
      void discover(const Arc& edge) {
565 569
        Node target = _graph.target(edge);
566 570
        _predMap.set(target, edge);
567 571
        _edgeStack.push(edge);
568 572
      }
569 573

	
570 574
      void examine(const Arc& edge) {
571 575
        Node source = _graph.source(edge);
572 576
        Node target = _graph.target(edge);
573 577
        if (source == target && _graph.direction(edge)) {
574 578
          _compMap.set(edge, _compNum);
575 579
          ++_compNum;
576 580
          return;
577 581
        }
578 582
        if (_numMap[target] < _numMap[source]) {
579 583
          if (_predMap[source] != _graph.oppositeArc(edge)) {
580 584
            _edgeStack.push(edge);
581 585
          }
582 586
        }
583 587
        if (_predMap[source] != INVALID &&
584 588
            target == _graph.source(_predMap[source])) {
585 589
          return;
586 590
        }
587 591
        if (_retMap[source] > _numMap[target]) {
588 592
          _retMap.set(source, _numMap[target]);
589 593
        }
590 594
      }
591 595

	
592 596
      void backtrack(const Arc& edge) {
593 597
        Node source = _graph.source(edge);
594 598
        Node target = _graph.target(edge);
595 599
        if (_retMap[source] > _retMap[target]) {
596 600
          _retMap.set(source, _retMap[target]);
597 601
        }
598 602
        if (_numMap[source] <= _retMap[target]) {
599 603
          while (_edgeStack.top() != edge) {
600 604
            _compMap.set(_edgeStack.top(), _compNum);
601 605
            _edgeStack.pop();
602 606
          }
603 607
          _compMap.set(edge, _compNum);
604 608
          _edgeStack.pop();
605 609
          ++_compNum;
606 610
        }
607 611
      }
608 612

	
609 613
    private:
610 614
      const Digraph& _graph;
611 615
      ArcMap& _compMap;
612 616
      int& _compNum;
613 617

	
614 618
      typename Digraph::template NodeMap<int> _numMap;
615 619
      typename Digraph::template NodeMap<int> _retMap;
616 620
      typename Digraph::template NodeMap<Arc> _predMap;
617 621
      std::stack<Edge> _edgeStack;
618 622
      int _num;
619 623
    };
620 624

	
621 625

	
622 626
    template <typename Digraph, typename NodeMap>
623 627
    class BiNodeConnectedCutNodesVisitor : public DfsVisitor<Digraph> {
624 628
    public:
625 629
      typedef typename Digraph::Node Node;
626 630
      typedef typename Digraph::Arc Arc;
627 631
      typedef typename Digraph::Edge Edge;
628 632

	
629 633
      BiNodeConnectedCutNodesVisitor(const Digraph& graph, NodeMap& cutMap,
630 634
                                     int& cutNum)
631 635
        : _graph(graph), _cutMap(cutMap), _cutNum(cutNum),
632 636
          _numMap(graph), _retMap(graph), _predMap(graph), _num(0) {}
633 637

	
634 638
      void start(const Node& node) {
635 639
        _predMap.set(node, INVALID);
636 640
        rootCut = false;
637 641
      }
638 642

	
639 643
      void reach(const Node& node) {
640 644
        _numMap.set(node, _num);
641 645
        _retMap.set(node, _num);
642 646
        ++_num;
643 647
      }
644 648

	
645 649
      void discover(const Arc& edge) {
646 650
        _predMap.set(_graph.target(edge), _graph.source(edge));
647 651
      }
648 652

	
649 653
      void examine(const Arc& edge) {
650 654
        if (_graph.source(edge) == _graph.target(edge) &&
651 655
            _graph.direction(edge)) {
652 656
          if (!_cutMap[_graph.source(edge)]) {
653 657
            _cutMap.set(_graph.source(edge), true);
654 658
            ++_cutNum;
655 659
          }
656 660
          return;
657 661
        }
658 662
        if (_predMap[_graph.source(edge)] == _graph.target(edge)) return;
659 663
        if (_retMap[_graph.source(edge)] > _numMap[_graph.target(edge)]) {
660 664
          _retMap.set(_graph.source(edge), _numMap[_graph.target(edge)]);
661 665
        }
662 666
      }
663 667

	
664 668
      void backtrack(const Arc& edge) {
665 669
        if (_retMap[_graph.source(edge)] > _retMap[_graph.target(edge)]) {
666 670
          _retMap.set(_graph.source(edge), _retMap[_graph.target(edge)]);
667 671
        }
668 672
        if (_numMap[_graph.source(edge)] <= _retMap[_graph.target(edge)]) {
669 673
          if (_predMap[_graph.source(edge)] != INVALID) {
670 674
            if (!_cutMap[_graph.source(edge)]) {
671 675
              _cutMap.set(_graph.source(edge), true);
672 676
              ++_cutNum;
673 677
            }
674 678
          } else if (rootCut) {
675 679
            if (!_cutMap[_graph.source(edge)]) {
676 680
              _cutMap.set(_graph.source(edge), true);
677 681
              ++_cutNum;
678 682
            }
679 683
          } else {
680 684
            rootCut = true;
681 685
          }
682 686
        }
683 687
      }
684 688

	
685 689
    private:
686 690
      const Digraph& _graph;
687 691
      NodeMap& _cutMap;
688 692
      int& _cutNum;
689 693

	
690 694
      typename Digraph::template NodeMap<int> _numMap;
691 695
      typename Digraph::template NodeMap<int> _retMap;
692 696
      typename Digraph::template NodeMap<Node> _predMap;
693 697
      std::stack<Edge> _edgeStack;
694 698
      int _num;
695 699
      bool rootCut;
696 700
    };
697 701

	
698 702
  }
699 703

	
700 704
  template <typename Graph>
701 705
  int countBiNodeConnectedComponents(const Graph& graph);
702 706

	
703
  /// \ingroup connectivity
707
  /// \ingroup graph_properties
704 708
  ///
705 709
  /// \brief Checks the graph is bi-node-connected.
706 710
  ///
707 711
  /// This function checks that the undirected graph is bi-node-connected
708 712
  /// graph. The graph is bi-node-connected if any two undirected edge is
709 713
  /// on same circle.
710 714
  ///
711 715
  /// \param graph The graph.
712 716
  /// \return \c true when the graph bi-node-connected.
713 717
  template <typename Graph>
714 718
  bool biNodeConnected(const Graph& graph) {
715 719
    return countBiNodeConnectedComponents(graph) <= 1;
716 720
  }
717 721

	
718
  /// \ingroup connectivity
722
  /// \ingroup graph_properties
719 723
  ///
720 724
  /// \brief Count the biconnected components.
721 725
  ///
722 726
  /// This function finds the bi-node-connected components in an undirected
723 727
  /// graph. The biconnected components are the classes of an equivalence
724 728
  /// relation on the undirected edges. Two undirected edge is in relationship
725 729
  /// when they are on same circle.
726 730
  ///
727 731
  /// \param graph The graph.
728 732
  /// \return The number of components.
729 733
  template <typename Graph>
730 734
  int countBiNodeConnectedComponents(const Graph& graph) {
731 735
    checkConcept<concepts::Graph, Graph>();
732 736
    typedef typename Graph::NodeIt NodeIt;
733 737

	
734 738
    using namespace _connectivity_bits;
735 739

	
736 740
    typedef CountBiNodeConnectedComponentsVisitor<Graph> Visitor;
737 741

	
738 742
    int compNum = 0;
739 743
    Visitor visitor(graph, compNum);
740 744

	
741 745
    DfsVisit<Graph, Visitor> dfs(graph, visitor);
742 746
    dfs.init();
743 747

	
744 748
    for (NodeIt it(graph); it != INVALID; ++it) {
745 749
      if (!dfs.reached(it)) {
746 750
        dfs.addSource(it);
747 751
        dfs.start();
748 752
      }
749 753
    }
750 754
    return compNum;
751 755
  }
752 756

	
753
  /// \ingroup connectivity
757
  /// \ingroup graph_properties
754 758
  ///
755 759
  /// \brief Find the bi-node-connected components.
756 760
  ///
757 761
  /// This function finds the bi-node-connected components in an undirected
758 762
  /// graph. The bi-node-connected components are the classes of an equivalence
759 763
  /// relation on the undirected edges. Two undirected edge are in relationship
760 764
  /// when they are on same circle.
761 765
  ///
766
  /// \image html node_biconnected_components.png
767
  /// \image latex node_biconnected_components.eps "bi-node-connected components" width=\textwidth
768
  ///
762 769
  /// \param graph The graph.
763 770
  /// \retval compMap A writable uedge map. The values will be set from 0
764 771
  /// to the number of the biconnected components minus one. Each values
765 772
  /// of the map will be set exactly once, the values of a certain component
766 773
  /// will be set continuously.
767 774
  /// \return The number of components.
768
  ///
769 775
  template <typename Graph, typename EdgeMap>
770 776
  int biNodeConnectedComponents(const Graph& graph,
771 777
                                EdgeMap& compMap) {
772 778
    checkConcept<concepts::Graph, Graph>();
773 779
    typedef typename Graph::NodeIt NodeIt;
774 780
    typedef typename Graph::Edge Edge;
775 781
    checkConcept<concepts::WriteMap<Edge, int>, EdgeMap>();
776 782

	
777 783
    using namespace _connectivity_bits;
778 784

	
779 785
    typedef BiNodeConnectedComponentsVisitor<Graph, EdgeMap> Visitor;
780 786

	
781 787
    int compNum = 0;
782 788
    Visitor visitor(graph, compMap, compNum);
783 789

	
784 790
    DfsVisit<Graph, Visitor> dfs(graph, visitor);
785 791
    dfs.init();
786 792

	
787 793
    for (NodeIt it(graph); it != INVALID; ++it) {
788 794
      if (!dfs.reached(it)) {
789 795
        dfs.addSource(it);
790 796
        dfs.start();
791 797
      }
792 798
    }
793 799
    return compNum;
794 800
  }
795 801

	
796
  /// \ingroup connectivity
802
  /// \ingroup graph_properties
797 803
  ///
798 804
  /// \brief Find the bi-node-connected cut nodes.
799 805
  ///
800 806
  /// This function finds the bi-node-connected cut nodes in an undirected
801 807
  /// graph. The bi-node-connected components are the classes of an equivalence
802 808
  /// relation on the undirected edges. Two undirected edges are in
803 809
  /// relationship when they are on same circle. The biconnected components
804 810
  /// are separted by nodes which are the cut nodes of the components.
805 811
  ///
806 812
  /// \param graph The graph.
807 813
  /// \retval cutMap A writable edge map. The values will be set true when
808 814
  /// the node separate two or more components.
809 815
  /// \return The number of the cut nodes.
810 816
  template <typename Graph, typename NodeMap>
811 817
  int biNodeConnectedCutNodes(const Graph& graph, NodeMap& cutMap) {
812 818
    checkConcept<concepts::Graph, Graph>();
813 819
    typedef typename Graph::Node Node;
814 820
    typedef typename Graph::NodeIt NodeIt;
815 821
    checkConcept<concepts::WriteMap<Node, bool>, NodeMap>();
816 822

	
817 823
    using namespace _connectivity_bits;
818 824

	
819 825
    typedef BiNodeConnectedCutNodesVisitor<Graph, NodeMap> Visitor;
820 826

	
821 827
    int cutNum = 0;
822 828
    Visitor visitor(graph, cutMap, cutNum);
823 829

	
824 830
    DfsVisit<Graph, Visitor> dfs(graph, visitor);
825 831
    dfs.init();
826 832

	
827 833
    for (NodeIt it(graph); it != INVALID; ++it) {
828 834
      if (!dfs.reached(it)) {
829 835
        dfs.addSource(it);
830 836
        dfs.start();
831 837
      }
832 838
    }
833 839
    return cutNum;
834 840
  }
835 841

	
836 842
  namespace _connectivity_bits {
837 843

	
838 844
    template <typename Digraph>
839 845
    class CountBiEdgeConnectedComponentsVisitor : public DfsVisitor<Digraph> {
840 846
    public:
841 847
      typedef typename Digraph::Node Node;
842 848
      typedef typename Digraph::Arc Arc;
843 849
      typedef typename Digraph::Edge Edge;
844 850

	
845 851
      CountBiEdgeConnectedComponentsVisitor(const Digraph& graph, int &compNum)
846 852
        : _graph(graph), _compNum(compNum),
847 853
          _numMap(graph), _retMap(graph), _predMap(graph), _num(0) {}
848 854

	
849 855
      void start(const Node& node) {
850 856
        _predMap.set(node, INVALID);
851 857
      }
852 858

	
853 859
      void reach(const Node& node) {
854 860
        _numMap.set(node, _num);
855 861
        _retMap.set(node, _num);
856 862
        ++_num;
857 863
      }
858 864

	
859 865
      void leave(const Node& node) {
860 866
        if (_numMap[node] <= _retMap[node]) {
861 867
          ++_compNum;
862 868
        }
863 869
      }
864 870

	
865 871
      void discover(const Arc& edge) {
866 872
        _predMap.set(_graph.target(edge), edge);
867 873
      }
868 874

	
869 875
      void examine(const Arc& edge) {
870 876
        if (_predMap[_graph.source(edge)] == _graph.oppositeArc(edge)) {
871 877
          return;
872 878
        }
873 879
        if (_retMap[_graph.source(edge)] > _retMap[_graph.target(edge)]) {
874 880
          _retMap.set(_graph.source(edge), _retMap[_graph.target(edge)]);
875 881
        }
876 882
      }
877 883

	
878 884
      void backtrack(const Arc& edge) {
879 885
        if (_retMap[_graph.source(edge)] > _retMap[_graph.target(edge)]) {
880 886
          _retMap.set(_graph.source(edge), _retMap[_graph.target(edge)]);
881 887
        }
882 888
      }
883 889

	
884 890
    private:
885 891
      const Digraph& _graph;
886 892
      int& _compNum;
887 893

	
888 894
      typename Digraph::template NodeMap<int> _numMap;
889 895
      typename Digraph::template NodeMap<int> _retMap;
890 896
      typename Digraph::template NodeMap<Arc> _predMap;
891 897
      int _num;
892 898
    };
893 899

	
894 900
    template <typename Digraph, typename NodeMap>
895 901
    class BiEdgeConnectedComponentsVisitor : public DfsVisitor<Digraph> {
896 902
    public:
897 903
      typedef typename Digraph::Node Node;
898 904
      typedef typename Digraph::Arc Arc;
899 905
      typedef typename Digraph::Edge Edge;
900 906

	
901 907
      BiEdgeConnectedComponentsVisitor(const Digraph& graph,
902 908
                                       NodeMap& compMap, int &compNum)
903 909
        : _graph(graph), _compMap(compMap), _compNum(compNum),
904 910
          _numMap(graph), _retMap(graph), _predMap(graph), _num(0) {}
905 911

	
906 912
      void start(const Node& node) {
907 913
        _predMap.set(node, INVALID);
908 914
      }
909 915

	
910 916
      void reach(const Node& node) {
911 917
        _numMap.set(node, _num);
912 918
        _retMap.set(node, _num);
913 919
        _nodeStack.push(node);
914 920
        ++_num;
915 921
      }
916 922

	
917 923
      void leave(const Node& node) {
918 924
        if (_numMap[node] <= _retMap[node]) {
919 925
          while (_nodeStack.top() != node) {
920 926
            _compMap.set(_nodeStack.top(), _compNum);
921 927
            _nodeStack.pop();
922 928
          }
923 929
          _compMap.set(node, _compNum);
924 930
          _nodeStack.pop();
925 931
          ++_compNum;
926 932
        }
927 933
      }
928 934

	
929 935
      void discover(const Arc& edge) {
930 936
        _predMap.set(_graph.target(edge), edge);
931 937
      }
932 938

	
933 939
      void examine(const Arc& edge) {
934 940
        if (_predMap[_graph.source(edge)] == _graph.oppositeArc(edge)) {
935 941
          return;
936 942
        }
937 943
        if (_retMap[_graph.source(edge)] > _retMap[_graph.target(edge)]) {
938 944
          _retMap.set(_graph.source(edge), _retMap[_graph.target(edge)]);
939 945
        }
940 946
      }
941 947

	
942 948
      void backtrack(const Arc& edge) {
943 949
        if (_retMap[_graph.source(edge)] > _retMap[_graph.target(edge)]) {
944 950
          _retMap.set(_graph.source(edge), _retMap[_graph.target(edge)]);
945 951
        }
946 952
      }
947 953

	
948 954
    private:
949 955
      const Digraph& _graph;
950 956
      NodeMap& _compMap;
951 957
      int& _compNum;
952 958

	
953 959
      typename Digraph::template NodeMap<int> _numMap;
954 960
      typename Digraph::template NodeMap<int> _retMap;
955 961
      typename Digraph::template NodeMap<Arc> _predMap;
956 962
      std::stack<Node> _nodeStack;
957 963
      int _num;
958 964
    };
959 965

	
960 966

	
961 967
    template <typename Digraph, typename ArcMap>
962 968
    class BiEdgeConnectedCutEdgesVisitor : public DfsVisitor<Digraph> {
963 969
    public:
964 970
      typedef typename Digraph::Node Node;
965 971
      typedef typename Digraph::Arc Arc;
966 972
      typedef typename Digraph::Edge Edge;
967 973

	
968 974
      BiEdgeConnectedCutEdgesVisitor(const Digraph& graph,
969 975
                                     ArcMap& cutMap, int &cutNum)
970 976
        : _graph(graph), _cutMap(cutMap), _cutNum(cutNum),
971 977
          _numMap(graph), _retMap(graph), _predMap(graph), _num(0) {}
972 978

	
973 979
      void start(const Node& node) {
974 980
        _predMap[node] = INVALID;
975 981
      }
976 982

	
977 983
      void reach(const Node& node) {
978 984
        _numMap.set(node, _num);
979 985
        _retMap.set(node, _num);
980 986
        ++_num;
981 987
      }
982 988

	
983 989
      void leave(const Node& node) {
984 990
        if (_numMap[node] <= _retMap[node]) {
985 991
          if (_predMap[node] != INVALID) {
986 992
            _cutMap.set(_predMap[node], true);
987 993
            ++_cutNum;
988 994
          }
989 995
        }
990 996
      }
991 997

	
992 998
      void discover(const Arc& edge) {
993 999
        _predMap.set(_graph.target(edge), edge);
994 1000
      }
995 1001

	
996 1002
      void examine(const Arc& edge) {
997 1003
        if (_predMap[_graph.source(edge)] == _graph.oppositeArc(edge)) {
998 1004
          return;
999 1005
        }
1000 1006
        if (_retMap[_graph.source(edge)] > _retMap[_graph.target(edge)]) {
1001 1007
          _retMap.set(_graph.source(edge), _retMap[_graph.target(edge)]);
1002 1008
        }
1003 1009
      }
1004 1010

	
1005 1011
      void backtrack(const Arc& edge) {
1006 1012
        if (_retMap[_graph.source(edge)] > _retMap[_graph.target(edge)]) {
1007 1013
          _retMap.set(_graph.source(edge), _retMap[_graph.target(edge)]);
1008 1014
        }
1009 1015
      }
1010 1016

	
1011 1017
    private:
1012 1018
      const Digraph& _graph;
1013 1019
      ArcMap& _cutMap;
1014 1020
      int& _cutNum;
1015 1021

	
1016 1022
      typename Digraph::template NodeMap<int> _numMap;
1017 1023
      typename Digraph::template NodeMap<int> _retMap;
1018 1024
      typename Digraph::template NodeMap<Arc> _predMap;
1019 1025
      int _num;
1020 1026
    };
1021 1027
  }
1022 1028

	
1023 1029
  template <typename Graph>
1024 1030
  int countBiEdgeConnectedComponents(const Graph& graph);
1025 1031

	
1026
  /// \ingroup connectivity
1032
  /// \ingroup graph_properties
1027 1033
  ///
1028 1034
  /// \brief Checks that the graph is bi-edge-connected.
1029 1035
  ///
1030 1036
  /// This function checks that the graph is bi-edge-connected. The undirected
1031 1037
  /// graph is bi-edge-connected when any two nodes are connected with two
1032 1038
  /// edge-disjoint paths.
1033 1039
  ///
1034 1040
  /// \param graph The undirected graph.
1035 1041
  /// \return The number of components.
1036 1042
  template <typename Graph>
1037 1043
  bool biEdgeConnected(const Graph& graph) {
1038 1044
    return countBiEdgeConnectedComponents(graph) <= 1;
1039 1045
  }
1040 1046

	
1041
  /// \ingroup connectivity
1047
  /// \ingroup graph_properties
1042 1048
  ///
1043 1049
  /// \brief Count the bi-edge-connected components.
1044 1050
  ///
1045 1051
  /// This function count the bi-edge-connected components in an undirected
1046 1052
  /// graph. The bi-edge-connected components are the classes of an equivalence
1047 1053
  /// relation on the nodes. Two nodes are in relationship when they are
1048 1054
  /// connected with at least two edge-disjoint paths.
1049 1055
  ///
1050 1056
  /// \param graph The undirected graph.
1051 1057
  /// \return The number of components.
1052 1058
  template <typename Graph>
1053 1059
  int countBiEdgeConnectedComponents(const Graph& graph) {
1054 1060
    checkConcept<concepts::Graph, Graph>();
1055 1061
    typedef typename Graph::NodeIt NodeIt;
1056 1062

	
1057 1063
    using namespace _connectivity_bits;
1058 1064

	
1059 1065
    typedef CountBiEdgeConnectedComponentsVisitor<Graph> Visitor;
1060 1066

	
1061 1067
    int compNum = 0;
1062 1068
    Visitor visitor(graph, compNum);
1063 1069

	
1064 1070
    DfsVisit<Graph, Visitor> dfs(graph, visitor);
1065 1071
    dfs.init();
1066 1072

	
1067 1073
    for (NodeIt it(graph); it != INVALID; ++it) {
1068 1074
      if (!dfs.reached(it)) {
1069 1075
        dfs.addSource(it);
1070 1076
        dfs.start();
1071 1077
      }
1072 1078
    }
1073 1079
    return compNum;
1074 1080
  }
1075 1081

	
1076
  /// \ingroup connectivity
1082
  /// \ingroup graph_properties
1077 1083
  ///
1078 1084
  /// \brief Find the bi-edge-connected components.
1079 1085
  ///
1080 1086
  /// This function finds the bi-edge-connected components in an undirected
1081 1087
  /// graph. The bi-edge-connected components are the classes of an equivalence
1082 1088
  /// relation on the nodes. Two nodes are in relationship when they are
1083 1089
  /// connected at least two edge-disjoint paths.
1084 1090
  ///
1091
  /// \image html edge_biconnected_components.png
1092
  /// \image latex edge_biconnected_components.eps "bi-edge-connected components" width=\textwidth
1093
  ///
1085 1094
  /// \param graph The graph.
1086 1095
  /// \retval compMap A writable node map. The values will be set from 0 to
1087 1096
  /// the number of the biconnected components minus one. Each values
1088 1097
  /// of the map will be set exactly once, the values of a certain component
1089 1098
  /// will be set continuously.
1090 1099
  /// \return The number of components.
1091
  ///
1092 1100
  template <typename Graph, typename NodeMap>
1093 1101
  int biEdgeConnectedComponents(const Graph& graph, NodeMap& compMap) {
1094 1102
    checkConcept<concepts::Graph, Graph>();
1095 1103
    typedef typename Graph::NodeIt NodeIt;
1096 1104
    typedef typename Graph::Node Node;
1097 1105
    checkConcept<concepts::WriteMap<Node, int>, NodeMap>();
1098 1106

	
1099 1107
    using namespace _connectivity_bits;
1100 1108

	
1101 1109
    typedef BiEdgeConnectedComponentsVisitor<Graph, NodeMap> Visitor;
1102 1110

	
1103 1111
    int compNum = 0;
1104 1112
    Visitor visitor(graph, compMap, compNum);
1105 1113

	
1106 1114
    DfsVisit<Graph, Visitor> dfs(graph, visitor);
1107 1115
    dfs.init();
1108 1116

	
1109 1117
    for (NodeIt it(graph); it != INVALID; ++it) {
1110 1118
      if (!dfs.reached(it)) {
1111 1119
        dfs.addSource(it);
1112 1120
        dfs.start();
1113 1121
      }
1114 1122
    }
1115 1123
    return compNum;
1116 1124
  }
1117 1125

	
1118
  /// \ingroup connectivity
1126
  /// \ingroup graph_properties
1119 1127
  ///
1120 1128
  /// \brief Find the bi-edge-connected cut edges.
1121 1129
  ///
1122 1130
  /// This function finds the bi-edge-connected components in an undirected
1123 1131
  /// graph. The bi-edge-connected components are the classes of an equivalence
1124 1132
  /// relation on the nodes. Two nodes are in relationship when they are
1125 1133
  /// connected with at least two edge-disjoint paths. The bi-edge-connected
1126 1134
  /// components are separted by edges which are the cut edges of the
1127 1135
  /// components.
1128 1136
  ///
1129 1137
  /// \param graph The graph.
1130 1138
  /// \retval cutMap A writable node map. The values will be set true when the
1131 1139
  /// edge is a cut edge.
1132 1140
  /// \return The number of cut edges.
1133 1141
  template <typename Graph, typename EdgeMap>
1134 1142
  int biEdgeConnectedCutEdges(const Graph& graph, EdgeMap& cutMap) {
1135 1143
    checkConcept<concepts::Graph, Graph>();
1136 1144
    typedef typename Graph::NodeIt NodeIt;
1137 1145
    typedef typename Graph::Edge Edge;
1138 1146
    checkConcept<concepts::WriteMap<Edge, bool>, EdgeMap>();
1139 1147

	
1140 1148
    using namespace _connectivity_bits;
1141 1149

	
1142 1150
    typedef BiEdgeConnectedCutEdgesVisitor<Graph, EdgeMap> Visitor;
1143 1151

	
1144 1152
    int cutNum = 0;
1145 1153
    Visitor visitor(graph, cutMap, cutNum);
1146 1154

	
1147 1155
    DfsVisit<Graph, Visitor> dfs(graph, visitor);
1148 1156
    dfs.init();
1149 1157

	
1150 1158
    for (NodeIt it(graph); it != INVALID; ++it) {
1151 1159
      if (!dfs.reached(it)) {
1152 1160
        dfs.addSource(it);
1153 1161
        dfs.start();
1154 1162
      }
1155 1163
    }
1156 1164
    return cutNum;
1157 1165
  }
1158 1166

	
1159 1167

	
1160 1168
  namespace _connectivity_bits {
1161 1169

	
1162 1170
    template <typename Digraph, typename IntNodeMap>
1163 1171
    class TopologicalSortVisitor : public DfsVisitor<Digraph> {
1164 1172
    public:
1165 1173
      typedef typename Digraph::Node Node;
1166 1174
      typedef typename Digraph::Arc edge;
1167 1175

	
1168 1176
      TopologicalSortVisitor(IntNodeMap& order, int num)
1169 1177
        : _order(order), _num(num) {}
1170 1178

	
1171 1179
      void leave(const Node& node) {
1172 1180
        _order.set(node, --_num);
1173 1181
      }
1174 1182

	
1175 1183
    private:
1176 1184
      IntNodeMap& _order;
1177 1185
      int _num;
1178 1186
    };
1179 1187

	
1180 1188
  }
1181 1189

	
1182
  /// \ingroup connectivity
1190
  /// \ingroup graph_properties
1183 1191
  ///
1184 1192
  /// \brief Sort the nodes of a DAG into topolgical order.
1185 1193
  ///
1186 1194
  /// Sort the nodes of a DAG into topolgical order.
1187 1195
  ///
1188 1196
  /// \param graph The graph. It must be directed and acyclic.
1189 1197
  /// \retval order A writable node map. The values will be set from 0 to
1190 1198
  /// the number of the nodes in the graph minus one. Each values of the map
1191 1199
  /// will be set exactly once, the values  will be set descending order.
1192 1200
  ///
1193 1201
  /// \see checkedTopologicalSort
1194 1202
  /// \see dag
1195 1203
  template <typename Digraph, typename NodeMap>
1196 1204
  void topologicalSort(const Digraph& graph, NodeMap& order) {
1197 1205
    using namespace _connectivity_bits;
1198 1206

	
1199 1207
    checkConcept<concepts::Digraph, Digraph>();
1200 1208
    checkConcept<concepts::WriteMap<typename Digraph::Node, int>, NodeMap>();
1201 1209

	
1202 1210
    typedef typename Digraph::Node Node;
1203 1211
    typedef typename Digraph::NodeIt NodeIt;
1204 1212
    typedef typename Digraph::Arc Arc;
1205 1213

	
1206 1214
    TopologicalSortVisitor<Digraph, NodeMap>
1207 1215
      visitor(order, countNodes(graph));
1208 1216

	
1209 1217
    DfsVisit<Digraph, TopologicalSortVisitor<Digraph, NodeMap> >
1210 1218
      dfs(graph, visitor);
1211 1219

	
1212 1220
    dfs.init();
1213 1221
    for (NodeIt it(graph); it != INVALID; ++it) {
1214 1222
      if (!dfs.reached(it)) {
1215 1223
        dfs.addSource(it);
1216 1224
        dfs.start();
1217 1225
      }
1218 1226
    }
1219 1227
  }
1220 1228

	
1221
  /// \ingroup connectivity
1229
  /// \ingroup graph_properties
1222 1230
  ///
1223 1231
  /// \brief Sort the nodes of a DAG into topolgical order.
1224 1232
  ///
1225 1233
  /// Sort the nodes of a DAG into topolgical order. It also checks
1226 1234
  /// that the given graph is DAG.
1227 1235
  ///
1228 1236
  /// \param digraph The graph. It must be directed and acyclic.
1229 1237
  /// \retval order A readable - writable node map. The values will be set
1230 1238
  /// from 0 to the number of the nodes in the graph minus one. Each values
1231 1239
  /// of the map will be set exactly once, the values will be set descending
1232 1240
  /// order.
1233 1241
  /// \return \c false when the graph is not DAG.
1234 1242
  ///
1235 1243
  /// \see topologicalSort
1236 1244
  /// \see dag
1237 1245
  template <typename Digraph, typename NodeMap>
1238 1246
  bool checkedTopologicalSort(const Digraph& digraph, NodeMap& order) {
1239 1247
    using namespace _connectivity_bits;
1240 1248

	
1241 1249
    checkConcept<concepts::Digraph, Digraph>();
1242 1250
    checkConcept<concepts::ReadWriteMap<typename Digraph::Node, int>,
1243 1251
      NodeMap>();
1244 1252

	
1245 1253
    typedef typename Digraph::Node Node;
1246 1254
    typedef typename Digraph::NodeIt NodeIt;
1247 1255
    typedef typename Digraph::Arc Arc;
1248 1256

	
1249 1257
    for (NodeIt it(digraph); it != INVALID; ++it) {
1250 1258
      order.set(it, -1);
1251 1259
    }
1252 1260

	
1253 1261
    TopologicalSortVisitor<Digraph, NodeMap>
1254 1262
      visitor(order, countNodes(digraph));
1255 1263

	
1256 1264
    DfsVisit<Digraph, TopologicalSortVisitor<Digraph, NodeMap> >
1257 1265
      dfs(digraph, visitor);
1258 1266

	
1259 1267
    dfs.init();
1260 1268
    for (NodeIt it(digraph); it != INVALID; ++it) {
1261 1269
      if (!dfs.reached(it)) {
1262 1270
        dfs.addSource(it);
1263 1271
        while (!dfs.emptyQueue()) {
1264 1272
           Arc arc = dfs.nextArc();
1265 1273
           Node target = digraph.target(arc);
1266 1274
           if (dfs.reached(target) && order[target] == -1) {
1267 1275
             return false;
1268 1276
           }
1269 1277
           dfs.processNextArc();
1270 1278
         }
1271 1279
      }
1272 1280
    }
1273 1281
    return true;
1274 1282
  }
1275 1283

	
1276
  /// \ingroup connectivity
1284
  /// \ingroup graph_properties
1277 1285
  ///
1278 1286
  /// \brief Check that the given directed graph is a DAG.
1279 1287
  ///
1280 1288
  /// Check that the given directed graph is a DAG. The DAG is
1281 1289
  /// an Directed Acyclic Digraph.
1282 1290
  /// \return \c false when the graph is not DAG.
1283 1291
  /// \see acyclic
1284 1292
  template <typename Digraph>
1285 1293
  bool dag(const Digraph& digraph) {
1286 1294

	
1287 1295
    checkConcept<concepts::Digraph, Digraph>();
1288 1296

	
1289 1297
    typedef typename Digraph::Node Node;
1290 1298
    typedef typename Digraph::NodeIt NodeIt;
1291 1299
    typedef typename Digraph::Arc Arc;
1292 1300

	
1293 1301
    typedef typename Digraph::template NodeMap<bool> ProcessedMap;
1294 1302

	
1295 1303
    typename Dfs<Digraph>::template SetProcessedMap<ProcessedMap>::
1296 1304
      Create dfs(digraph);
1297 1305

	
1298 1306
    ProcessedMap processed(digraph);
1299 1307
    dfs.processedMap(processed);
1300 1308

	
1301 1309
    dfs.init();
1302 1310
    for (NodeIt it(digraph); it != INVALID; ++it) {
1303 1311
      if (!dfs.reached(it)) {
1304 1312
        dfs.addSource(it);
1305 1313
        while (!dfs.emptyQueue()) {
1306 1314
          Arc edge = dfs.nextArc();
1307 1315
          Node target = digraph.target(edge);
1308 1316
          if (dfs.reached(target) && !processed[target]) {
1309 1317
            return false;
1310 1318
          }
1311 1319
          dfs.processNextArc();
1312 1320
        }
1313 1321
      }
1314 1322
    }
1315 1323
    return true;
1316 1324
  }
1317 1325

	
1318
  /// \ingroup connectivity
1326
  /// \ingroup graph_properties
1319 1327
  ///
1320 1328
  /// \brief Check that the given undirected graph is acyclic.
1321 1329
  ///
1322 1330
  /// Check that the given undirected graph acyclic.
1323 1331
  /// \param graph The undirected graph.
1324 1332
  /// \return \c true when there is no circle in the graph.
1325 1333
  /// \see dag
1326 1334
  template <typename Graph>
1327 1335
  bool acyclic(const Graph& graph) {
1328 1336
    checkConcept<concepts::Graph, Graph>();
1329 1337
    typedef typename Graph::Node Node;
1330 1338
    typedef typename Graph::NodeIt NodeIt;
1331 1339
    typedef typename Graph::Arc Arc;
1332 1340
    Dfs<Graph> dfs(graph);
1333 1341
    dfs.init();
1334 1342
    for (NodeIt it(graph); it != INVALID; ++it) {
1335 1343
      if (!dfs.reached(it)) {
1336 1344
        dfs.addSource(it);
1337 1345
        while (!dfs.emptyQueue()) {
1338 1346
          Arc edge = dfs.nextArc();
1339 1347
          Node source = graph.source(edge);
1340 1348
          Node target = graph.target(edge);
1341 1349
          if (dfs.reached(target) &&
1342 1350
              dfs.predArc(source) != graph.oppositeArc(edge)) {
1343 1351
            return false;
1344 1352
          }
1345 1353
          dfs.processNextArc();
1346 1354
        }
1347 1355
      }
1348 1356
    }
1349 1357
    return true;
1350 1358
  }
1351 1359

	
1352
  /// \ingroup connectivity
1360
  /// \ingroup graph_properties
1353 1361
  ///
1354 1362
  /// \brief Check that the given undirected graph is tree.
1355 1363
  ///
1356 1364
  /// Check that the given undirected graph is tree.
1357 1365
  /// \param graph The undirected graph.
1358 1366
  /// \return \c true when the graph is acyclic and connected.
1359 1367
  template <typename Graph>
1360 1368
  bool tree(const Graph& graph) {
1361 1369
    checkConcept<concepts::Graph, Graph>();
1362 1370
    typedef typename Graph::Node Node;
1363 1371
    typedef typename Graph::NodeIt NodeIt;
1364 1372
    typedef typename Graph::Arc Arc;
1365 1373
    Dfs<Graph> dfs(graph);
1366 1374
    dfs.init();
1367 1375
    dfs.addSource(NodeIt(graph));
1368 1376
    while (!dfs.emptyQueue()) {
1369 1377
      Arc edge = dfs.nextArc();
1370 1378
      Node source = graph.source(edge);
1371 1379
      Node target = graph.target(edge);
1372 1380
      if (dfs.reached(target) &&
1373 1381
          dfs.predArc(source) != graph.oppositeArc(edge)) {
1374 1382
        return false;
1375 1383
      }
1376 1384
      dfs.processNextArc();
1377 1385
    }
1378 1386
    for (NodeIt it(graph); it != INVALID; ++it) {
1379 1387
      if (!dfs.reached(it)) {
1380 1388
        return false;
1381 1389
      }
1382 1390
    }
1383 1391
    return true;
1384 1392
  }
1385 1393

	
1386 1394
  namespace _connectivity_bits {
1387 1395

	
1388 1396
    template <typename Digraph>
1389 1397
    class BipartiteVisitor : public BfsVisitor<Digraph> {
1390 1398
    public:
1391 1399
      typedef typename Digraph::Arc Arc;
1392 1400
      typedef typename Digraph::Node Node;
1393 1401

	
1394 1402
      BipartiteVisitor(const Digraph& graph, bool& bipartite)
1395 1403
        : _graph(graph), _part(graph), _bipartite(bipartite) {}
1396 1404

	
1397 1405
      void start(const Node& node) {
1398 1406
        _part[node] = true;
1399 1407
      }
1400 1408
      void discover(const Arc& edge) {
1401 1409
        _part.set(_graph.target(edge), !_part[_graph.source(edge)]);
1402 1410
      }
1403 1411
      void examine(const Arc& edge) {
1404 1412
        _bipartite = _bipartite &&
1405 1413
          _part[_graph.target(edge)] != _part[_graph.source(edge)];
1406 1414
      }
1407 1415

	
1408 1416
    private:
1409 1417

	
1410 1418
      const Digraph& _graph;
1411 1419
      typename Digraph::template NodeMap<bool> _part;
1412 1420
      bool& _bipartite;
1413 1421
    };
1414 1422

	
1415 1423
    template <typename Digraph, typename PartMap>
1416 1424
    class BipartitePartitionsVisitor : public BfsVisitor<Digraph> {
1417 1425
    public:
1418 1426
      typedef typename Digraph::Arc Arc;
1419 1427
      typedef typename Digraph::Node Node;
1420 1428

	
1421 1429
      BipartitePartitionsVisitor(const Digraph& graph,
1422 1430
                                 PartMap& part, bool& bipartite)
1423 1431
        : _graph(graph), _part(part), _bipartite(bipartite) {}
1424 1432

	
1425 1433
      void start(const Node& node) {
1426 1434
        _part.set(node, true);
1427 1435
      }
1428 1436
      void discover(const Arc& edge) {
1429 1437
        _part.set(_graph.target(edge), !_part[_graph.source(edge)]);
1430 1438
      }
1431 1439
      void examine(const Arc& edge) {
1432 1440
        _bipartite = _bipartite &&
1433 1441
          _part[_graph.target(edge)] != _part[_graph.source(edge)];
1434 1442
      }
1435 1443

	
1436 1444
    private:
1437 1445

	
1438 1446
      const Digraph& _graph;
1439 1447
      PartMap& _part;
1440 1448
      bool& _bipartite;
1441 1449
    };
1442 1450
  }
1443 1451

	
1444
  /// \ingroup connectivity
1452
  /// \ingroup graph_properties
1445 1453
  ///
1446 1454
  /// \brief Check if the given undirected graph is bipartite or not
1447 1455
  ///
1448 1456
  /// The function checks if the given undirected \c graph graph is bipartite
1449 1457
  /// or not. The \ref Bfs algorithm is used to calculate the result.
1450 1458
  /// \param graph The undirected graph.
1451 1459
  /// \return \c true if \c graph is bipartite, \c false otherwise.
1452 1460
  /// \sa bipartitePartitions
1453 1461
  template<typename Graph>
1454 1462
  inline bool bipartite(const Graph &graph){
1455 1463
    using namespace _connectivity_bits;
1456 1464

	
1457 1465
    checkConcept<concepts::Graph, Graph>();
1458 1466

	
1459 1467
    typedef typename Graph::NodeIt NodeIt;
1460 1468
    typedef typename Graph::ArcIt ArcIt;
1461 1469

	
1462 1470
    bool bipartite = true;
1463 1471

	
1464 1472
    BipartiteVisitor<Graph>
1465 1473
      visitor(graph, bipartite);
1466 1474
    BfsVisit<Graph, BipartiteVisitor<Graph> >
1467 1475
      bfs(graph, visitor);
1468 1476
    bfs.init();
1469 1477
    for(NodeIt it(graph); it != INVALID; ++it) {
1470 1478
      if(!bfs.reached(it)){
1471 1479
        bfs.addSource(it);
1472 1480
        while (!bfs.emptyQueue()) {
1473 1481
          bfs.processNextNode();
1474 1482
          if (!bipartite) return false;
1475 1483
        }
1476 1484
      }
1477 1485
    }
1478 1486
    return true;
1479 1487
  }
1480 1488

	
1481
  /// \ingroup connectivity
1489
  /// \ingroup graph_properties
1482 1490
  ///
1483 1491
  /// \brief Check if the given undirected graph is bipartite or not
1484 1492
  ///
1485 1493
  /// The function checks if the given undirected graph is bipartite
1486 1494
  /// or not. The  \ref  Bfs  algorithm  is   used  to  calculate the result.
1487 1495
  /// During the execution, the \c partMap will be set as the two
1488 1496
  /// partitions of the graph.
1497
  ///
1498
  /// \image html bipartite_partitions.png
1499
  /// \image latex bipartite_partitions.eps "Bipartite partititions" width=\textwidth
1500
  ///
1489 1501
  /// \param graph The undirected graph.
1490 1502
  /// \retval partMap A writable bool map of nodes. It will be set as the
1491 1503
  /// two partitions of the graph.
1492 1504
  /// \return \c true if \c graph is bipartite, \c false otherwise.
1493 1505
  template<typename Graph, typename NodeMap>
1494 1506
  inline bool bipartitePartitions(const Graph &graph, NodeMap &partMap){
1495 1507
    using namespace _connectivity_bits;
1496 1508

	
1497 1509
    checkConcept<concepts::Graph, Graph>();
1498 1510

	
1499 1511
    typedef typename Graph::Node Node;
1500 1512
    typedef typename Graph::NodeIt NodeIt;
1501 1513
    typedef typename Graph::ArcIt ArcIt;
1502 1514

	
1503 1515
    bool bipartite = true;
1504 1516

	
1505 1517
    BipartitePartitionsVisitor<Graph, NodeMap>
1506 1518
      visitor(graph, partMap, bipartite);
1507 1519
    BfsVisit<Graph, BipartitePartitionsVisitor<Graph, NodeMap> >
1508 1520
      bfs(graph, visitor);
1509 1521
    bfs.init();
1510 1522
    for(NodeIt it(graph); it != INVALID; ++it) {
1511 1523
      if(!bfs.reached(it)){
1512 1524
        bfs.addSource(it);
1513 1525
        while (!bfs.emptyQueue()) {
1514 1526
          bfs.processNextNode();
1515 1527
          if (!bipartite) return false;
1516 1528
        }
1517 1529
      }
1518 1530
    }
1519 1531
    return true;
1520 1532
  }
1521 1533

	
1522 1534
  /// \brief Returns true when there are not loop edges in the graph.
1523 1535
  ///
1524 1536
  /// Returns true when there are not loop edges in the graph.
1525 1537
  template <typename Digraph>
1526 1538
  bool loopFree(const Digraph& digraph) {
1527 1539
    for (typename Digraph::ArcIt it(digraph); it != INVALID; ++it) {
1528 1540
      if (digraph.source(it) == digraph.target(it)) return false;
1529 1541
    }
1530 1542
    return true;
1531 1543
  }
1532 1544

	
1533 1545
  /// \brief Returns true when there are not parallel edges in the graph.
1534 1546
  ///
1535 1547
  /// Returns true when there are not parallel edges in the graph.
1536 1548
  template <typename Digraph>
1537 1549
  bool parallelFree(const Digraph& digraph) {
1538 1550
    typename Digraph::template NodeMap<bool> reached(digraph, false);
1539 1551
    for (typename Digraph::NodeIt n(digraph); n != INVALID; ++n) {
1540 1552
      for (typename Digraph::OutArcIt a(digraph, n); a != INVALID; ++a) {
1541 1553
        if (reached[digraph.target(a)]) return false;
1542 1554
        reached.set(digraph.target(a), true);
1543 1555
      }
1544 1556
      for (typename Digraph::OutArcIt a(digraph, n); a != INVALID; ++a) {
1545 1557
        reached.set(digraph.target(a), false);
1546 1558
      }
1547 1559
    }
1548 1560
    return true;
1549 1561
  }
1550 1562

	
1551 1563
  /// \brief Returns true when there are not loop edges and parallel
1552 1564
  /// edges in the graph.
1553 1565
  ///
1554 1566
  /// Returns true when there are not loop edges and parallel edges in
1555 1567
  /// the graph.
1556 1568
  template <typename Digraph>
1557 1569
  bool simpleDigraph(const Digraph& digraph) {
1558 1570
    typename Digraph::template NodeMap<bool> reached(digraph, false);
1559 1571
    for (typename Digraph::NodeIt n(digraph); n != INVALID; ++n) {
1560 1572
      reached.set(n, true);
1561 1573
      for (typename Digraph::OutArcIt a(digraph, n); a != INVALID; ++a) {
1562 1574
        if (reached[digraph.target(a)]) return false;
1563 1575
        reached.set(digraph.target(a), true);
1564 1576
      }
1565 1577
      for (typename Digraph::OutArcIt a(digraph, n); a != INVALID; ++a) {
1566 1578
        reached.set(digraph.target(a), false);
1567 1579
      }
1568 1580
      reached.set(n, false);
1569 1581
    }
1570 1582
    return true;
1571 1583
  }
1572 1584

	
1573 1585
} //namespace lemon
1574 1586

	
1575 1587
#endif //LEMON_CONNECTIVITY_H
Ignore white space 6 line context
1 1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
2 2
 *
3 3
 * This file is a part of LEMON, a generic C++ optimization library.
4 4
 *
5 5
 * Copyright (C) 2003-2009
6 6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
8 8
 *
9 9
 * Permission to use, modify and distribute this software is granted
10 10
 * provided that this copyright notice appears in all copies. For
11 11
 * precise terms see the accompanying LICENSE file.
12 12
 *
13 13
 * This software is provided "AS IS" with no warranty of any kind,
14 14
 * express or implied, and with no claim as to its suitability for any
15 15
 * purpose.
16 16
 *
17 17
 */
18 18

	
19 19
#ifndef LEMON_EULER_H
20 20
#define LEMON_EULER_H
21 21

	
22 22
#include<lemon/core.h>
23 23
#include<lemon/adaptors.h>
24 24
#include<lemon/connectivity.h>
25 25
#include <list>
26 26

	
27
/// \ingroup graph_prop
27
/// \ingroup graph_properties
28 28
/// \file
29 29
/// \brief Euler tour
30 30
///
31 31
///This file provides an Euler tour iterator and ways to check
32 32
///if a digraph is euler.
33 33

	
34 34

	
35 35
namespace lemon {
36 36

	
37 37
  ///Euler iterator for digraphs.
38 38

	
39
  /// \ingroup graph_prop
39
  /// \ingroup graph_properties
40 40
  ///This iterator converts to the \c Arc type of the digraph and using
41 41
  ///operator ++, it provides an Euler tour of a \e directed
42 42
  ///graph (if there exists).
43 43
  ///
44 44
  ///For example
45 45
  ///if the given digraph is Euler (i.e it has only one nontrivial component
46 46
  ///and the in-degree is equal to the out-degree for all nodes),
47 47
  ///the following code will put the arcs of \c g
48 48
  ///to the vector \c et according to an
49 49
  ///Euler tour of \c g.
50 50
  ///\code
51 51
  ///  std::vector<ListDigraph::Arc> et;
52 52
  ///  for(DiEulerIt<ListDigraph> e(g),e!=INVALID;++e)
53 53
  ///    et.push_back(e);
54 54
  ///\endcode
55 55
  ///If \c g is not Euler then the resulted tour will not be full or closed.
56 56
  ///\sa EulerIt
57 57
  template<typename GR>
58 58
  class DiEulerIt
59 59
  {
60 60
    typedef typename GR::Node Node;
61 61
    typedef typename GR::NodeIt NodeIt;
62 62
    typedef typename GR::Arc Arc;
63 63
    typedef typename GR::ArcIt ArcIt;
64 64
    typedef typename GR::OutArcIt OutArcIt;
65 65
    typedef typename GR::InArcIt InArcIt;
66 66

	
67 67
    const GR &g;
68 68
    typename GR::template NodeMap<OutArcIt> nedge;
69 69
    std::list<Arc> euler;
70 70

	
71 71
  public:
72 72

	
73 73
    ///Constructor
74 74

	
75 75
    ///\param gr A digraph.
76 76
    ///\param start The starting point of the tour. If it is not given
77 77
    ///       the tour will start from the first node.
78 78
    DiEulerIt(const GR &gr, typename GR::Node start = INVALID)
79 79
      : g(gr), nedge(g)
80 80
    {
81 81
      if(start==INVALID) start=NodeIt(g);
82 82
      for(NodeIt n(g);n!=INVALID;++n) nedge[n]=OutArcIt(g,n);
83 83
      while(nedge[start]!=INVALID) {
84 84
        euler.push_back(nedge[start]);
85 85
        Node next=g.target(nedge[start]);
86 86
        ++nedge[start];
87 87
        start=next;
88 88
      }
89 89
    }
90 90

	
91 91
    ///Arc Conversion
92 92
    operator Arc() { return euler.empty()?INVALID:euler.front(); }
93 93
    bool operator==(Invalid) { return euler.empty(); }
94 94
    bool operator!=(Invalid) { return !euler.empty(); }
95 95

	
96 96
    ///Next arc of the tour
97 97
    DiEulerIt &operator++() {
98 98
      Node s=g.target(euler.front());
99 99
      euler.pop_front();
100 100
      //This produces a warning.Strange.
101 101
      //std::list<Arc>::iterator next=euler.begin();
102 102
      typename std::list<Arc>::iterator next=euler.begin();
103 103
      while(nedge[s]!=INVALID) {
104 104
        euler.insert(next,nedge[s]);
105 105
        Node n=g.target(nedge[s]);
106 106
        ++nedge[s];
107 107
        s=n;
108 108
      }
109 109
      return *this;
110 110
    }
111 111
    ///Postfix incrementation
112 112

	
113 113
    ///\warning This incrementation
114 114
    ///returns an \c Arc, not an \ref DiEulerIt, as one may
115 115
    ///expect.
116 116
    Arc operator++(int)
117 117
    {
118 118
      Arc e=*this;
119 119
      ++(*this);
120 120
      return e;
121 121
    }
122 122
  };
123 123

	
124 124
  ///Euler iterator for graphs.
125 125

	
126
  /// \ingroup graph_prop
126
  /// \ingroup graph_properties
127 127
  ///This iterator converts to the \c Arc (or \c Edge)
128 128
  ///type of the digraph and using
129 129
  ///operator ++, it provides an Euler tour of an undirected
130 130
  ///digraph (if there exists).
131 131
  ///
132 132
  ///For example
133 133
  ///if the given digraph if Euler (i.e it has only one nontrivial component
134 134
  ///and the degree of each node is even),
135 135
  ///the following code will print the arc IDs according to an
136 136
  ///Euler tour of \c g.
137 137
  ///\code
138 138
  ///  for(EulerIt<ListGraph> e(g),e!=INVALID;++e) {
139 139
  ///    std::cout << g.id(Edge(e)) << std::eol;
140 140
  ///  }
141 141
  ///\endcode
142 142
  ///Although the iterator provides an Euler tour of an graph,
143 143
  ///it still returns Arcs in order to indicate the direction of the tour.
144 144
  ///(But Arc will convert to Edges, of course).
145 145
  ///
146 146
  ///If \c g is not Euler then the resulted tour will not be full or closed.
147 147
  ///\sa EulerIt
148 148
  template<typename GR>
149 149
  class EulerIt
150 150
  {
151 151
    typedef typename GR::Node Node;
152 152
    typedef typename GR::NodeIt NodeIt;
153 153
    typedef typename GR::Arc Arc;
154 154
    typedef typename GR::Edge Edge;
155 155
    typedef typename GR::ArcIt ArcIt;
156 156
    typedef typename GR::OutArcIt OutArcIt;
157 157
    typedef typename GR::InArcIt InArcIt;
158 158

	
159 159
    const GR &g;
160 160
    typename GR::template NodeMap<OutArcIt> nedge;
161 161
    typename GR::template EdgeMap<bool> visited;
162 162
    std::list<Arc> euler;
163 163

	
164 164
  public:
165 165

	
166 166
    ///Constructor
167 167

	
168 168
    ///\param gr An graph.
169 169
    ///\param start The starting point of the tour. If it is not given
170 170
    ///       the tour will start from the first node.
171 171
    EulerIt(const GR &gr, typename GR::Node start = INVALID)
172 172
      : g(gr), nedge(g), visited(g, false)
173 173
    {
174 174
      if(start==INVALID) start=NodeIt(g);
175 175
      for(NodeIt n(g);n!=INVALID;++n) nedge[n]=OutArcIt(g,n);
176 176
      while(nedge[start]!=INVALID) {
177 177
        euler.push_back(nedge[start]);
178 178
        visited[nedge[start]]=true;
179 179
        Node next=g.target(nedge[start]);
180 180
        ++nedge[start];
181 181
        start=next;
182 182
        while(nedge[start]!=INVALID && visited[nedge[start]]) ++nedge[start];
183 183
      }
184 184
    }
185 185

	
186 186
    ///Arc Conversion
187 187
    operator Arc() const { return euler.empty()?INVALID:euler.front(); }
188 188
    ///Arc Conversion
189 189
    operator Edge() const { return euler.empty()?INVALID:euler.front(); }
190 190
    ///\e
191 191
    bool operator==(Invalid) const { return euler.empty(); }
192 192
    ///\e
193 193
    bool operator!=(Invalid) const { return !euler.empty(); }
194 194

	
195 195
    ///Next arc of the tour
196 196
    EulerIt &operator++() {
197 197
      Node s=g.target(euler.front());
198 198
      euler.pop_front();
199 199
      typename std::list<Arc>::iterator next=euler.begin();
200 200

	
201 201
      while(nedge[s]!=INVALID) {
202 202
        while(nedge[s]!=INVALID && visited[nedge[s]]) ++nedge[s];
203 203
        if(nedge[s]==INVALID) break;
204 204
        else {
205 205
          euler.insert(next,nedge[s]);
206 206
          visited[nedge[s]]=true;
207 207
          Node n=g.target(nedge[s]);
208 208
          ++nedge[s];
209 209
          s=n;
210 210
        }
211 211
      }
212 212
      return *this;
213 213
    }
214 214

	
215 215
    ///Postfix incrementation
216 216

	
217 217
    ///\warning This incrementation
218 218
    ///returns an \c Arc, not an \ref EulerIt, as one may
219 219
    ///expect.
220 220
    Arc operator++(int)
221 221
    {
222 222
      Arc e=*this;
223 223
      ++(*this);
224 224
      return e;
225 225
    }
226 226
  };
227 227

	
228 228

	
229 229
  ///Checks if the graph is Eulerian
230 230

	
231
  /// \ingroup graph_prop
231
  /// \ingroup graph_properties
232 232
  ///Checks if the graph is Eulerian. It works for both directed and undirected
233 233
  ///graphs.
234 234
  ///\note By definition, a digraph is called \e Eulerian if
235 235
  ///and only if it is connected and the number of its incoming and outgoing
236 236
  ///arcs are the same for each node.
237 237
  ///Similarly, an undirected graph is called \e Eulerian if
238 238
  ///and only if it is connected and the number of incident arcs is even
239 239
  ///for each node. <em>Therefore, there are digraphs which are not Eulerian,
240 240
  ///but still have an Euler tour</em>.
241 241
  template<typename GR>
242 242
#ifdef DOXYGEN
243 243
  bool
244 244
#else
245 245
  typename enable_if<UndirectedTagIndicator<GR>,bool>::type
246 246
  eulerian(const GR &g)
247 247
  {
248 248
    for(typename GR::NodeIt n(g);n!=INVALID;++n)
249 249
      if(countIncEdges(g,n)%2) return false;
250 250
    return connected(g);
251 251
  }
252 252
  template<class GR>
253 253
  typename disable_if<UndirectedTagIndicator<GR>,bool>::type
254 254
#endif
255 255
  eulerian(const GR &g)
256 256
  {
257 257
    for(typename GR::NodeIt n(g);n!=INVALID;++n)
258 258
      if(countInArcs(g,n)!=countOutArcs(g,n)) return false;
259 259
    return connected(Undirector<const GR>(g));
260 260
  }
261 261

	
262 262
}
263 263

	
264 264
#endif
0 comments (0 inline)