Skip to content

saisubham/booster-placement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

booster-placement

To compile the program type the following command

$ cd /download_path/booster-placement/
$ make all

To run the program

$ ./tvs input_file.txt

Some sample input files are provided in /test folder. To see how they work type

$ make all
$ ./tvs ./test/input2.txt

Input file syntax

#nodes limit
<source_vertex> <destination_vertex> <weight>
<source_vertex> <destination_vertex> <weight>
<source_vertex> <destination_vertex> <weight>
...

To clean the directory

$ make clean

sample input

9 100
0 1 22
0 2 9
0 3 12
1 2 35
1 5 36
1 7 34
2 3 4
2 4 65
2 5 42
3 4 33
3 8 30
4 5 18
4 6 23
5 6 39
5 7 24
6 7 25
6 8 21
7 8 19

sample output

Input: (limit = 100)

[0] A
├── [22] B
│   ├── [35] C
│   │   ├── [4] D
│   │   │   ├── [33] E
│   │   │   │   ├── [18] F
│   │   │   │   │   ├── [39] G
│   │   │   │   │   │   ├── [25] H
│   │   │   │   │   │   │   └── [19] I
│   │   │   │   │   │   └── [21] I
│   │   │   │   │   └── [24] H
│   │   │   │   │       └── [19] I
│   │   │   │   └── [23] G
│   │   │   │       ├── [25] H
│   │   │   │       │   └── [19] I
│   │   │   │       └── [21] I
│   │   │   └── [30] I
│   │   ├── [65] E
│   │   │   ├── [18] F
│   │   │   │   ├── [39] G
│   │   │   │   │   ├── [25] H
│   │   │   │   │   │   └── [19] I
│   │   │   │   │   └── [21] I
│   │   │   │   └── [24] H
│   │   │   │       └── [19] I
│   │   │   └── [23] G
│   │   │       ├── [25] H
│   │   │       │   └── [19] I
│   │   │       └── [21] I
│   │   └── [42] F
│   │       ├── [39] G
│   │       │   ├── [25] H
│   │       │   │   └── [19] I
│   │       │   └── [21] I
│   │       └── [24] H
│   │           └── [19] I
│   ├── [36] F
│   │   ├── [39] G
│   │   │   ├── [25] H
│   │   │   │   └── [19] I
│   │   │   └── [21] I
│   │   └── [24] H
│   │       └── [19] I
│   └── [34] H
│       └── [19] I
├── [9] C
│   ├── [4] D
│   │   ├── [33] E
│   │   │   ├── [18] F
│   │   │   │   ├── [39] G
│   │   │   │   │   ├── [25] H
│   │   │   │   │   │   └── [19] I
│   │   │   │   │   └── [21] I
│   │   │   │   └── [24] H
│   │   │   │       └── [19] I
│   │   │   └── [23] G
│   │   │       ├── [25] H
│   │   │       │   └── [19] I
│   │   │       └── [21] I
│   │   └── [30] I
│   ├── [65] E
│   │   ├── [18] F
│   │   │   ├── [39] G
│   │   │   │   ├── [25] H
│   │   │   │   │   └── [19] I
│   │   │   │   └── [21] I
│   │   │   └── [24] H
│   │   │       └── [19] I
│   │   └── [23] G
│   │       ├── [25] H
│   │       │   └── [19] I
│   │       └── [21] I
│   └── [42] F
│       ├── [39] G
│       │   ├── [25] H
│       │   │   └── [19] I
│       │   └── [21] I
│       └── [24] H
│           └── [19] I
└── [12] D
    ├── [33] E
    │   ├── [18] F
    │   │   ├── [39] G
    │   │   │   ├── [25] H
    │   │   │   │   └── [19] I
    │   │   │   └── [21] I
    │   │   └── [24] H
    │   │       └── [19] I
    │   └── [23] G
    │       ├── [25] H
    │       │   └── [19] I
    │       └── [21] I
    └── [30] I

Working

[33] E
├── [18] F
│   ├── [39] G
│   │   ├── [25] H
│   │   │   └── [19] I
│   │   └── [21] I
│   └── [24] H
│       └── [19] I
└── [23] G
    ├── [25] H
    │   └── [19] I
    └── [21] I

[65] E
├── [18] F
│   ├── [39] G
│   │   ├── [25] H
│   │   │   └── [19] I
│   │   └── [21] I
│   └── [24] H
│       └── [19] I
└── [23] G
    ├── [25] H
    │   └── [19] I
    └── [21] I

[35] C
├── [4] D
│   ├── [33] E
│   └── [30] I
├── [65] E
└── [42] F
    ├── [39] G
    │   ├── [25] H
    │   │   └── [19] I
    │   └── [21] I
    └── [24] H
        └── [19] I

[22] B
├── [35] C
├── [36] F
│   ├── [39] G
│   │   ├── [25] H
│   │   │   └── [19] I
│   │   └── [21] I
│   └── [24] H
│       └── [19] I
└── [34] H
    └── [19] I

[33] E
├── [18] F
│   ├── [39] G
│   │   ├── [25] H
│   │   │   └── [19] I
│   │   └── [21] I
│   └── [24] H
│       └── [19] I
└── [23] G
    ├── [25] H
    │   └── [19] I
    └── [21] I

[65] E
├── [18] F
│   ├── [39] G
│   │   ├── [25] H
│   │   │   └── [19] I
│   │   └── [21] I
│   └── [24] H
│       └── [19] I
└── [23] G
    ├── [25] H
    │   └── [19] I
    └── [21] I

[9] C
├── [4] D
│   ├── [33] E
│   └── [30] I
├── [65] E
└── [42] F
    ├── [39] G
    │   ├── [25] H
    │   │   └── [19] I
    │   └── [21] I
    └── [24] H
        └── [19] I

[33] E
├── [18] F
│   ├── [39] G
│   │   ├── [25] H
│   │   │   └── [19] I
│   │   └── [21] I
│   └── [24] H
│       └── [19] I
└── [23] G
    ├── [25] H
    │   └── [19] I
    └── [21] I

[0] A
├── [22] B
├── [9] C
└── [12] D
    ├── [33] E
    └── [30] I

[0] A

Booster placement at: A B C E