-
Notifications
You must be signed in to change notification settings - Fork 0
/
Open_Me_First.html
649 lines (617 loc) · 23.5 KB
/
Open_Me_First.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
<!DOCTYPE html>
<html>
<head>
<!-- Site made with Mobirise Website Builder v4.12.2, https://mobirise.com -->
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="generator" content="Mobirise v4.12.2, mobirise.com" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, minimum-scale=1"
/>
<link
rel="shortcut icon"
href="assets/images/1024px-bits-pilani-logo.svg-122x122.png"
type="image/x-icon"
/>
<meta name="description" content="" />
<title>DAA Assignment 1</title>
<link
rel="stylesheet"
href="assets/web/assets/mobirise-icons2/mobirise2.css"
/>
<link
rel="stylesheet"
href="assets/web/assets/mobirise-icons/mobirise-icons.css"
/>
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap-grid.min.css" />
<link
rel="stylesheet"
href="assets/bootstrap/css/bootstrap-reboot.min.css"
/>
<link rel="stylesheet" href="assets/dropdown/css/style.css" />
<link
rel="stylesheet"
href="assets/datatables/data-tables.bootstrap4.min.css"
/>
<link rel="stylesheet" href="assets/tether/tether.min.css" />
<link rel="stylesheet" href="assets/theme/css/style.css" />
<link
rel="preload"
as="style"
href="assets/mobirise/css/mbr-additional.css"
/>
<link
rel="stylesheet"
href="assets/mobirise/css/mbr-additional.css"
type="text/css"
/>
</head>
<body>
<section class="menu cid-rSR5Y7ZTio" once="menu" id="menu1-6">
<nav
class="navbar navbar-expand beta-menu navbar-dropdown align-items-center navbar-fixed-top navbar-toggleable-sm"
>
<button
class="navbar-toggler navbar-toggler-right"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<div class="hamburger">
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</button>
<div class="menu-logo">
<div class="navbar-brand">
<span class="navbar-logo">
<a href="https://www.bits-pilani.ac.in/hyderabad/">
<img
src="assets/images/1024px-bits-pilani-logo.svg-122x122.png"
alt="Mobirise"
title=""
style="height: 3.8rem;"
/>
</a>
</span>
<span class="navbar-caption-wrap"
><a
class="navbar-caption text-white display-4"
href="https://universe.bits-pilani.ac.in/hyderabad/tathagatr/Courses"
target="_blank"
>
CS F364 Design and Analysis of Algorithms</a
></span
>
</div>
</div>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav nav-dropdown" data-app-modern-menu="true">
<li class="nav-item">
<a
class="nav-link link text-white display-4"
href="index.html#table1-d"
><span
class="mobi-mbri mobi-mbri-users mbr-iconfont mbr-iconfont-btn"
></span>
Group Members</a
>
</li>
</ul>
<div class="navbar-buttons mbr-section-btn">
<a
class="btn btn-sm btn-primary display-4"
href="assets/files/Assignment 1.pdf"
target="_blank"
>
<span class="mbri-save mbr-iconfont mbr-iconfont-btn "></span>
Full Assigment</a
>
</div>
</div>
</nav>
</section>
<section class="engine">
<a href="https://mobirise.info/f">simple web builder</a>
</section>
<section
class="cid-rSR53kLlcK mbr-fullscreen mbr-parallax-background"
id="header2-5"
>
<div
class="mbr-overlay"
style="opacity: 0.5; background-color: rgb(35, 35, 35);"
></div>
<div class="container align-center">
<div class="row justify-content-md-center">
<div class="mbr-white col-md-10">
<h1
class="mbr-section-title mbr-bold pb-3 mbr-fonts-style display-1"
>
Assignment 1
</h1>
<p class="mbr-text pb-3 mbr-fonts-style display-5">
The objective of this assignment is to read a research paper based
on Divide-and-Conquer to identify the Strongly Connected
Components in a Directed Graph and implement it. <br />Also
compare it with more traditional algorithm. Experiment with many
different data sets and compare results.
</p>
<div class="mbr-section-btn">
<a
class="btn btn-md btn-secondary display-4"
href="assets/files/Assignment 1.pdf"
>LEARN MORE</a
>
</div>
</div>
</div>
</div>
<div class="mbr-arrow hidden-sm-down" aria-hidden="true">
<a href="#next">
<i class="mbri-down mbr-iconfont"></i>
</a>
</div>
</section>
<section class="mbr-section info2 cid-rSRyLSM0oX" id="info2-a">
<div class="container">
<div class="row main justify-content-center">
<div class="media-container-column col-12 col-lg-3 col-md-4"></div>
<div class="media-container-column title col-12 col-lg-7 col-md-6">
<h2
class="align-right mbr-bold mbr-white pb-3 mbr-fonts-style display-2"
>
Task 1
</h2>
<h3
class="mbr-section-subtitle align-right mbr-light mbr-white mbr-fonts-style display-5"
>
<strong
>To find the Strongly Connected Components using Depth First
Search</strong
>
<div>
In this question we used the traditional Kosaraju algorithm to
find the Strongly Connected Components of the Graph. We called
the DFS function twice. First time to get the finishing time of
DFS for all the nodes and Second time to get the Strongly
Connected Components
</div>
</h3>
</div>
</div>
</div>
</section>
<section class="mbr-section info2 cid-rSRyMh4B9x" id="info2-b">
<div class="container">
<div class="row main justify-content-center">
<div class="media-container-column col-12 col-lg-3 col-md-4"></div>
<div class="media-container-column title col-12 col-lg-7 col-md-6">
<h2
class="align-right mbr-bold mbr-white pb-3 mbr-fonts-style display-2"
>
Task 2
</h2>
<h3
class="mbr-section-subtitle align-right mbr-light mbr-white mbr-fonts-style display-5"
>
<strong
>To find the Strongly Connected Components using Divide and
Conquer algorithm</strong
>
<div>
In this question, we use the Divide and Conquer algorithm as
given in the research paper to get the Strongly Connected
Components. The lemma goes as
</div>
<div>Let G be a directed graph with vertex v. Then</div>
<div>
SCC(G,v) = <span
style="font-size: 1.5rem; background-color: initial;"
>Desc(G,v)∩Pred(G,v); and every other strongly connected
component in SCC(G) </span
><span style="background-color: initial; font-size: 1.5rem;"
>is a strongly connected component of exactly one of (
Desc(G,v) \ SCC(G,v) ),</span
>
</div>
<div>(Pred(G,v) \ SCC(G,v) ), or [ Rem(G,v) ].</div>
<div>
Click
<td class="body-item mbr-fonts-style display-7">
<a href="assets/files/Paper.pdf" target="_blank">here</a>
</td>
to check out the Research paper
</div>
</h3>
</div>
</div>
</div>
</section>
<section class="section-table cid-rSREFqRvXp" id="table1-d">
<div class="container container-table">
<h2
class="mbr-section-title mbr-fonts-style align-center pb-3 display-2"
>
Group Members
</h2>
<div class="table-wrapper">
<div class="container"></div>
<div class="container scroll">
<table class="table" cellspacing="0">
<thead>
<tr class="table-heads ">
<th class="head-item mbr-fonts-style display-7">
NAME
</th>
<th class="head-item mbr-fonts-style display-7">ID NUMBER</th>
</tr>
</thead>
<tbody>
<tr>
<td class="body-item mbr-fonts-style display-7">
Anish Walia
</td>
<td class="body-item mbr-fonts-style display-7">
2017A7PS0035H
</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">Anish Dey</td>
<td class="body-item mbr-fonts-style display-7">
2017A7PS0220H
</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">
Aniruddh Gupta
</td>
<td class="body-item mbr-fonts-style display-7">
2017A7PS0149H
</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">
Shikhar Dhawale
</td>
<td class="body-item mbr-fonts-style display-7">
2017A7PS0049H
</td>
</tr>
</tbody>
</table>
</div>
<div class="container table-info-container"></div>
</div>
</div>
</section>
<section class="services5 cid-rSRGKIRl1z" id="services5-e">
<!---->
<!---->
<!--Overlay-->
<!--Container-->
<div class="container">
<div class="row">
<!--Titles-->
<div class="title pb-5 col-12">
<h2 class="align-left mbr-fonts-style m-0 display-1">
Navigation
</h2>
</div>
<!--Card-1-->
<div class="card px-3 col-12">
<div class="card-wrapper media-container-row media-container-row">
<div class="card-box">
<div class="top-line pb-3">
<h4 class="card-title mbr-fonts-style display-5">
./
</h4>
<p class="mbr-text cost mbr-fonts-style m-0 display-5"></p>
</div>
<div class="bottom-line">
<p class="mbr-text mbr-fonts-style m-0 b-descr display-7">
Contains folders Q1, Q2, Test Cases and python file for
visualization.
</p>
</div>
</div>
</div>
</div>
<!--Card-2-->
<div class="card px-3 col-12">
<div class="card-wrapper media-container-row media-container-row">
<div class="card-box">
<div class="top-line pb-3">
<h4 class="card-title mbr-fonts-style display-5">
./Q1
</h4>
<p class="mbr-text cost mbr-fonts-style m-0 display-5"></p>
</div>
<div class="bottom-line">
<p class="mbr-text mbr-fonts-style m-0 b-descr display-7">
Contains cpp file and documentation for question 1.
</p>
</div>
</div>
</div>
</div>
<!--Card-3-->
<div class="card px-3 col-12">
<div class="card-wrapper media-container-row media-container-row">
<div class="card-box">
<div class="top-line pb-3">
<h4 class="card-title mbr-fonts-style display-5">
./Q2
</h4>
<p class="mbr-text cost mbr-fonts-style m-0 display-5"></p>
</div>
<div class="bottom-line">
<p class="mbr-text mbr-fonts-style m-0 b-descr display-7">
Contains cpp file and documentation for question 2 part 1
and part 2.
</p>
</div>
</div>
</div>
</div>
<!--Card-4-->
<div class="card px-3 col-12">
<div class="card-wrapper media-container-row media-container-row">
<div class="card-box">
<div class="top-line pb-3">
<h4 class="card-title mbr-fonts-style display-5">
./Test Cases
</h4>
<p class="mbr-text cost mbr-fonts-style m-0 display-5"></p>
</div>
<div class="bottom-line">
<p class="mbr-text mbr-fonts-style m-0 b-descr display-7">
Contains Test Cases for given questions.
</p>
</div>
</div>
</div>
</div>
<!--Card-5-->
<!--Card-6-->
<!--Card-7-->
<!--Card-8-->
<!--Card-9-->
<!--Card-10-->
<!--Card-11-->
<!--Card-12-->
</div>
</div>
</section>
<section class="section-table cid-rSRTbf2zer" id="table1-g">
<div class="container container-table">
<h2
class="mbr-section-title mbr-fonts-style align-center pb-3 display-2"
>
Test Cases
</h2>
<div class="table-wrapper">
<div class="container"></div>
<div class="container scroll">
<table class="table" cellspacing="0">
<thead>
<tr class="table-heads ">
<th class="head-item mbr-fonts-style display-7">
NAME
</th>
<th class="head-item mbr-fonts-style display-7">Q1 OUTPUT</th>
<th class="head-item mbr-fonts-style display-7">Q2 OUTPUT</th>
</tr>
</thead>
<tbody>
<tr>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S1\S1.txt" target="_blank">S1</a>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S1\output\Q1_S1O.txt" target="_blank"
>Q1_S1O</a
>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S1\output\Q2_S1O.txt" target="_blank"
>Q2_S1O</a
>
</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S2\S2.txt" target="_blank">S2</a>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S2\output\Q1_S2O.txt" target="_blank"
>Q1_S2O</a
>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S2\output\Q2_S2O.txt" target="_blank"
>Q2_S2O</a
>
</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S3\S3.txt" target="_blank">S3</a>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S3\output\Q1_S3O.txt" target="_blank"
>Q1_S3O</a
>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S3\output\Q2_S3O.txt" target="_blank"
>Q2_S3O</a
>
</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\L1\L1.txt" target="_blank">L1</a>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\L1\Output\Q1_LO1.txt" target="_blank"
>Q1_LO1</a
>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\L1\Output\Q2_LO1.txt" target="_blank"
>Q2_L01</a
><br />
</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\L2\L2.txt" target="_blank">L2</a>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\L2\Output\Q1_LO2.txt" target="_blank"
>Q1_LO2</a
>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\L2\Output\Q2_LO2.txt" target="_blank"
>Q2_LO2</a
>
</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\L3\L3.txt" target="_blank">L3</a>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\L3\Output\Q1_LO3.txt" target="_blank"
>Q1_LO3</a
>
</td>
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\L3\Output\Q2_LO3.txt" target="_blank"
>Q2_LO3</a
>
</td>
</tr>
</tbody>
</table>
</div>
<div class="container table-info-container"></div>
</div>
</div>
</section>
<section class="section-table cid-rSRM5iX42S" id="table1-f">
<div class="container container-table">
<h2
class="mbr-section-title mbr-fonts-style align-center pb-3 display-2"
>
Execution Time For Large Graphs
</h2>
<div class="table-wrapper">
<div class="container"></div>
<div class="container scroll">
<table class="table" cellspacing="0">
<thead>
<tr class="table-heads ">
<th class="head-item mbr-fonts-style display-7">
NAME
</th>
<th class="head-item mbr-fonts-style display-7">
Q1 (in secs)
</th>
<th class="head-item mbr-fonts-style display-7">
Q2 (in secs)
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="body-item mbr-fonts-style display-7">L1</td>
<td class="body-item mbr-fonts-style display-7">3</td>
<td class="body-item mbr-fonts-style display-7">22</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">L2</td>
<td class="body-item mbr-fonts-style display-7">1</td>
<td class="body-item mbr-fonts-style display-7">11</td>
</tr>
<tr>
<td class="body-item mbr-fonts-style display-7">L3</td>
<td class="body-item mbr-fonts-style display-7">4</td>
<td class="body-item mbr-fonts-style display-7">42</td>
</tr>
</tbody>
</table>
</div>
<div class="container table-info-container"></div>
</div>
</div>
</section>
<section class="mbr-section info2 cid-rSRyLSM0oX" id="info2-a">
<div class="container">
<div class="row main justify-content-center">
<div class="media-container-column col-12 col-lg-3 col-md-4"></div>
<div class="media-container-column title col-12 col-lg-7 col-md-6">
<h2
class="align-right mbr-bold mbr-white pb-3 mbr-fonts-style display-2"
>
Issues in Coding
</h2>
<h3
class="mbr-section-subtitle align-right mbr-light mbr-white mbr-fonts-style display-5"
>
<div>
Since we used unordered_map data structure in Q2 and map data
structure in Q1, the problem is that if we do not mention the id
of a particular node in the edge set entered by us, then those
nodes which are not connected by edges should be a part of the
SCCs but our code doesn't print those node id's but just print
blank lines for them. As for example Check this
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S1\S1.txt" target="_blank">Test Case</a>
</td>
and its
<td class="body-item mbr-fonts-style display-7">
<a href=".\Test_Cases\S1\output\Q1_S1O.txt" target="_blank">
Output</a
>
</td>
</div>
</h3>
</div>
</div>
</div>
</section>
<section once="footers" class="cid-rSRYpMnQlE" id="footer6-h">
<div class="container">
<div class="media-container-row align-center mbr-white">
<div class="col-12">
<p class="mbr-text mb-0 mbr-fonts-style display-7">
Thank You
</p>
</div>
</div>
</div>
</section>
<script src="assets/popper/popper.min.js"></script>
<script src="assets/web/assets/jquery/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/smoothscroll/smooth-scroll.js"></script>
<script src="assets/dropdown/js/nav-dropdown.js"></script>
<script src="assets/dropdown/js/navbar-dropdown.js"></script>
<script src="assets/touchswipe/jquery.touch-swipe.min.js"></script>
<script src="assets/datatables/jquery.data-tables.min.js"></script>
<script src="assets/datatables/data-tables.bootstrap4.min.js"></script>
<script src="assets/tether/tether.min.js"></script>
<script src="assets/parallax/jarallax.min.js"></script>
<script src="assets/theme/js/script.js"></script>
</body>
</html>