dancealgorithm 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dancealgorithm-0.1.0/src/dancealgorithm.egg-info → dancealgorithm-0.1.2}/PKG-INFO +22 -19
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/README.md +21 -18
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/pyproject.toml +4 -2
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/__init__.py +12 -9
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/__main__.py +1 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA - Campus/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA - Flight/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA - Smart/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/FK - Advertisement/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/FK - Electric/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/FK - Emergency/__init__.py +4 -0
- dancealgorithm-0.1.2/src/dancealgorithm/assignments/GC - Classroom/Solution.java +119 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/GC - Classroom/__init__.py +4 -0
- dancealgorithm-0.1.2/src/dancealgorithm/assignments/GC - Interference/Solution.java +120 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/GC - Interference/__init__.py +4 -0
- dancealgorithm-0.1.2/src/dancealgorithm/assignments/GC - University/Solution.java +119 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/GC - University/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/K - Cloud/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/K - Disaster/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/K - Hospital/__init__.py +4 -0
- dancealgorithm-0.1.2/src/dancealgorithm/assignments/LC - Delivery/Solution.java +261 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/LC - Delivery/__init__.py +4 -0
- dancealgorithm-0.1.2/src/dancealgorithm/assignments/LC - Drilling/Solution.java +275 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/LC - Drilling/__init__.py +4 -0
- dancealgorithm-0.1.2/src/dancealgorithm/assignments/LC - Flight/Solution.java +261 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/LC - Flight/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS - Commerce/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS - Customer/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS - Library/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MSG - Emergency/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MSG - Logistics/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MSG - Skyconnect/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS - Commerce/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS - Movie/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS - Online/__init__.py +4 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/__init__.py +25 -25
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/downloader.py +7 -6
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2/src/dancealgorithm.egg-info}/PKG-INFO +22 -19
- dancealgorithm-0.1.0/src/dancealgorithm/assignments/GC - Classroom/Solution.java +0 -87
- dancealgorithm-0.1.0/src/dancealgorithm/assignments/GC - Interference/Solution.java +0 -88
- dancealgorithm-0.1.0/src/dancealgorithm/assignments/GC - University/Solution.java +0 -88
- dancealgorithm-0.1.0/src/dancealgorithm/assignments/LC - Delivery/Solution.java +0 -180
- dancealgorithm-0.1.0/src/dancealgorithm/assignments/LC - Drilling/Solution.java +0 -197
- dancealgorithm-0.1.0/src/dancealgorithm/assignments/LC - Flight/Solution.java +0 -180
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/LICENSE +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/setup.cfg +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA - Campus/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA - Flight/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA - Smart/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/FK - Advertisement/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/FK - Electric/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/FK - Emergency/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/FK.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/GC.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/K - Cloud/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/K - Disaster/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/K - Hospital/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/K.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/LC.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS - Commerce/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS - Commerce/dataset.csv +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS - Customer/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS - Customer/dataset.csv +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS - Library/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS - Library/dataset.csv +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MS.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MSG - Emergency/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MSG - Logistics/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MSG - Skyconnect/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/MSG.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS - Commerce/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS - Commerce/dataset.csv +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS - Movie/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS - Movie/dataset.csv +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS - Online/Solution.java +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS - Online/dataset.csv +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/QS.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/cli.py +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/config.py +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm.egg-info/SOURCES.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm.egg-info/dependency_links.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm.egg-info/entry_points.txt +0 -0
- {dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dancealgorithm
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: DanceAlgorithm: Instant DAA Algorithms, Lab Problem Sheets, Datasets, and Code Vault.
|
|
5
5
|
Author: DanceAlgorithm Maintainer
|
|
6
6
|
License-Expression: MIT
|
|
@@ -26,10 +26,11 @@ Dynamic: license-file
|
|
|
26
26
|
# ⚡ DanceAlgorithm
|
|
27
27
|
|
|
28
28
|
> **Instant DAA Problem Sheets, Datasets, Solutions & Algorithm Vault**
|
|
29
|
-
> Download, extract, organize, and directly **import** all 24 Design & Analysis of Algorithms (DAA) lab practical problem sheets, datasets, and Java solutions cleanly onto your PC with a single command or Python import.
|
|
29
|
+
> Download, extract, organize, and directly **import** all 24 Design & Analysis of Algorithms (DAA) lab practical problem sheets, datasets, and Java solutions cleanly onto your PC or Linux machine with a single command or Python import.
|
|
30
30
|
|
|
31
31
|
[](https://pypi.org/project/dancealgorithm/)
|
|
32
32
|
[](https://www.python.org/)
|
|
33
|
+
[]()
|
|
33
34
|
[](https://opensource.org/licenses/MIT)
|
|
34
35
|
[]()
|
|
35
36
|
|
|
@@ -37,7 +38,7 @@ Dynamic: license-file
|
|
|
37
38
|
|
|
38
39
|
## 🌟 The Magic Experience
|
|
39
40
|
|
|
40
|
-
### Option A: Install & Extract All 24 Problem Sheets
|
|
41
|
+
### Option A: Install & Extract All 24 Problem Sheets
|
|
41
42
|
|
|
42
43
|
```powershell
|
|
43
44
|
pip install dancealgorithm; dance
|
|
@@ -49,7 +50,7 @@ Or run `dance` (or `dancealgorithm`) anytime in your terminal:
|
|
|
49
50
|
dance
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
Your `C:\DAA_Assignments` folder is cleanly populated with all 24 problem sheets:
|
|
53
|
+
Your `C:\DAA_Assignments` folder (or `~/DAA_Assignments` on Linux) is cleanly populated with all 24 problem sheets:
|
|
53
54
|
|
|
54
55
|
```text
|
|
55
56
|
C:\DAA_Assignments\
|
|
@@ -59,9 +60,10 @@ C:\DAA_Assignments\
|
|
|
59
60
|
├── MS - Commerce/
|
|
60
61
|
│ ├── dataset.csv
|
|
61
62
|
│ └── Solution.java
|
|
62
|
-
├── MS - Library/
|
|
63
63
|
├── ...
|
|
64
|
-
|
|
64
|
+
├── GC - University/
|
|
65
|
+
│ └── Solution.java
|
|
66
|
+
└── LC - Drilling/
|
|
65
67
|
└── Solution.java
|
|
66
68
|
```
|
|
67
69
|
|
|
@@ -83,9 +85,6 @@ dance QS.txt
|
|
|
83
85
|
# Dijkstra shortest path analysis
|
|
84
86
|
dance DA.txt
|
|
85
87
|
|
|
86
|
-
# Graph Coloring backtracking analysis
|
|
87
|
-
dance GC.txt
|
|
88
|
-
|
|
89
88
|
# Fractional Knapsack greedy proof
|
|
90
89
|
dance FK.txt
|
|
91
90
|
|
|
@@ -95,11 +94,14 @@ dance K.txt
|
|
|
95
94
|
# Multistage Graph backward DP
|
|
96
95
|
dance MSG.txt
|
|
97
96
|
|
|
98
|
-
#
|
|
97
|
+
# Graph Coloring backtracking analysis
|
|
98
|
+
dance GC.txt
|
|
99
|
+
|
|
100
|
+
# TSP - Least Cost Branch & Bound analysis
|
|
99
101
|
dance LC.txt
|
|
100
102
|
```
|
|
101
103
|
|
|
102
|
-
*(You can also use `dancealgorithm DA.txt` or `dance DA`)*
|
|
104
|
+
*(You can also use `dancealgorithm DA.txt`, `dance GC.txt`, or `dance DA`)*
|
|
103
105
|
|
|
104
106
|
### 2. Extract a Specific Assignment Folder
|
|
105
107
|
|
|
@@ -110,12 +112,13 @@ Extract only that particular folder:
|
|
|
110
112
|
dance MSG - Logistics
|
|
111
113
|
dance "DA - Smart"
|
|
112
114
|
dance "GC - Classroom"
|
|
113
|
-
dance "
|
|
115
|
+
dance "LC - Delivery"
|
|
114
116
|
|
|
115
117
|
# Or extract by problem number
|
|
116
118
|
dance 1
|
|
117
119
|
dance 13
|
|
118
120
|
dance 19
|
|
121
|
+
dance 24
|
|
119
122
|
```
|
|
120
123
|
|
|
121
124
|
### 3. List All Available Problem Sheets & Notes
|
|
@@ -143,7 +146,7 @@ dancealgorithm.extract("MSG - Logistics")
|
|
|
143
146
|
# 3. Extract all sheets to custom destination
|
|
144
147
|
dancealgorithm.extract(destination="D:/MyLabs")
|
|
145
148
|
|
|
146
|
-
# 4. Open destination folder in Windows
|
|
149
|
+
# 4. Open destination folder in system file manager (Windows, Linux, macOS)
|
|
147
150
|
dancealgorithm.open_folder()
|
|
148
151
|
```
|
|
149
152
|
|
|
@@ -171,12 +174,12 @@ dancealgorithm.open_folder()
|
|
|
171
174
|
| **16** | 0/1 Knapsack | Dynamic Programming | `K - Disaster` | $O(n \cdot W)$ |
|
|
172
175
|
| **17** | 0/1 Knapsack | Dynamic Programming | `K - Hospital` | $O(n \cdot W)$ |
|
|
173
176
|
| **18** | 0/1 Knapsack | Dynamic Programming | `K - Cloud` | $O(n \cdot W)$ |
|
|
174
|
-
| **19** | Graph Coloring | Backtracking | `GC -
|
|
175
|
-
| **20** | Graph Coloring | Backtracking | `GC -
|
|
176
|
-
| **21** | Graph Coloring | Backtracking | `GC -
|
|
177
|
-
| **22** | LC Branch
|
|
178
|
-
| **23** | LC Branch
|
|
179
|
-
| **24** | LC Branch
|
|
177
|
+
| **19** | Graph Coloring | Backtracking | `GC - University` | $O(V \cdot m^V)$ |
|
|
178
|
+
| **20** | Graph Coloring | Backtracking | `GC - Classroom` | $O(V \cdot m^V)$ |
|
|
179
|
+
| **21** | Graph Coloring | Backtracking | `GC - Interference` | $O(V \cdot m^V)$ |
|
|
180
|
+
| **22** | LC Branch and Bound | State Space Search | `LC - Delivery` | $O(n! \cdot n^2)$ |
|
|
181
|
+
| **23** | LC Branch and Bound | State Space Search | `LC - Flight` | $O(n! \cdot n^2)$ |
|
|
182
|
+
| **24** | LC Branch and Bound | State Space Search | `LC - Drilling` | $O(n! \cdot n^2)$ |
|
|
180
183
|
|
|
181
184
|
---
|
|
182
185
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# ⚡ DanceAlgorithm
|
|
2
2
|
|
|
3
3
|
> **Instant DAA Problem Sheets, Datasets, Solutions & Algorithm Vault**
|
|
4
|
-
> Download, extract, organize, and directly **import** all 24 Design & Analysis of Algorithms (DAA) lab practical problem sheets, datasets, and Java solutions cleanly onto your PC with a single command or Python import.
|
|
4
|
+
> Download, extract, organize, and directly **import** all 24 Design & Analysis of Algorithms (DAA) lab practical problem sheets, datasets, and Java solutions cleanly onto your PC or Linux machine with a single command or Python import.
|
|
5
5
|
|
|
6
6
|
[](https://pypi.org/project/dancealgorithm/)
|
|
7
7
|
[](https://www.python.org/)
|
|
8
|
+
[]()
|
|
8
9
|
[](https://opensource.org/licenses/MIT)
|
|
9
10
|
[]()
|
|
10
11
|
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
|
|
13
14
|
## 🌟 The Magic Experience
|
|
14
15
|
|
|
15
|
-
### Option A: Install & Extract All 24 Problem Sheets
|
|
16
|
+
### Option A: Install & Extract All 24 Problem Sheets
|
|
16
17
|
|
|
17
18
|
```powershell
|
|
18
19
|
pip install dancealgorithm; dance
|
|
@@ -24,7 +25,7 @@ Or run `dance` (or `dancealgorithm`) anytime in your terminal:
|
|
|
24
25
|
dance
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
Your `C:\DAA_Assignments` folder is cleanly populated with all 24 problem sheets:
|
|
28
|
+
Your `C:\DAA_Assignments` folder (or `~/DAA_Assignments` on Linux) is cleanly populated with all 24 problem sheets:
|
|
28
29
|
|
|
29
30
|
```text
|
|
30
31
|
C:\DAA_Assignments\
|
|
@@ -34,9 +35,10 @@ C:\DAA_Assignments\
|
|
|
34
35
|
├── MS - Commerce/
|
|
35
36
|
│ ├── dataset.csv
|
|
36
37
|
│ └── Solution.java
|
|
37
|
-
├── MS - Library/
|
|
38
38
|
├── ...
|
|
39
|
-
|
|
39
|
+
├── GC - University/
|
|
40
|
+
│ └── Solution.java
|
|
41
|
+
└── LC - Drilling/
|
|
40
42
|
└── Solution.java
|
|
41
43
|
```
|
|
42
44
|
|
|
@@ -58,9 +60,6 @@ dance QS.txt
|
|
|
58
60
|
# Dijkstra shortest path analysis
|
|
59
61
|
dance DA.txt
|
|
60
62
|
|
|
61
|
-
# Graph Coloring backtracking analysis
|
|
62
|
-
dance GC.txt
|
|
63
|
-
|
|
64
63
|
# Fractional Knapsack greedy proof
|
|
65
64
|
dance FK.txt
|
|
66
65
|
|
|
@@ -70,11 +69,14 @@ dance K.txt
|
|
|
70
69
|
# Multistage Graph backward DP
|
|
71
70
|
dance MSG.txt
|
|
72
71
|
|
|
73
|
-
#
|
|
72
|
+
# Graph Coloring backtracking analysis
|
|
73
|
+
dance GC.txt
|
|
74
|
+
|
|
75
|
+
# TSP - Least Cost Branch & Bound analysis
|
|
74
76
|
dance LC.txt
|
|
75
77
|
```
|
|
76
78
|
|
|
77
|
-
*(You can also use `dancealgorithm DA.txt` or `dance DA`)*
|
|
79
|
+
*(You can also use `dancealgorithm DA.txt`, `dance GC.txt`, or `dance DA`)*
|
|
78
80
|
|
|
79
81
|
### 2. Extract a Specific Assignment Folder
|
|
80
82
|
|
|
@@ -85,12 +87,13 @@ Extract only that particular folder:
|
|
|
85
87
|
dance MSG - Logistics
|
|
86
88
|
dance "DA - Smart"
|
|
87
89
|
dance "GC - Classroom"
|
|
88
|
-
dance "
|
|
90
|
+
dance "LC - Delivery"
|
|
89
91
|
|
|
90
92
|
# Or extract by problem number
|
|
91
93
|
dance 1
|
|
92
94
|
dance 13
|
|
93
95
|
dance 19
|
|
96
|
+
dance 24
|
|
94
97
|
```
|
|
95
98
|
|
|
96
99
|
### 3. List All Available Problem Sheets & Notes
|
|
@@ -118,7 +121,7 @@ dancealgorithm.extract("MSG - Logistics")
|
|
|
118
121
|
# 3. Extract all sheets to custom destination
|
|
119
122
|
dancealgorithm.extract(destination="D:/MyLabs")
|
|
120
123
|
|
|
121
|
-
# 4. Open destination folder in Windows
|
|
124
|
+
# 4. Open destination folder in system file manager (Windows, Linux, macOS)
|
|
122
125
|
dancealgorithm.open_folder()
|
|
123
126
|
```
|
|
124
127
|
|
|
@@ -146,12 +149,12 @@ dancealgorithm.open_folder()
|
|
|
146
149
|
| **16** | 0/1 Knapsack | Dynamic Programming | `K - Disaster` | $O(n \cdot W)$ |
|
|
147
150
|
| **17** | 0/1 Knapsack | Dynamic Programming | `K - Hospital` | $O(n \cdot W)$ |
|
|
148
151
|
| **18** | 0/1 Knapsack | Dynamic Programming | `K - Cloud` | $O(n \cdot W)$ |
|
|
149
|
-
| **19** | Graph Coloring | Backtracking | `GC -
|
|
150
|
-
| **20** | Graph Coloring | Backtracking | `GC -
|
|
151
|
-
| **21** | Graph Coloring | Backtracking | `GC -
|
|
152
|
-
| **22** | LC Branch
|
|
153
|
-
| **23** | LC Branch
|
|
154
|
-
| **24** | LC Branch
|
|
152
|
+
| **19** | Graph Coloring | Backtracking | `GC - University` | $O(V \cdot m^V)$ |
|
|
153
|
+
| **20** | Graph Coloring | Backtracking | `GC - Classroom` | $O(V \cdot m^V)$ |
|
|
154
|
+
| **21** | Graph Coloring | Backtracking | `GC - Interference` | $O(V \cdot m^V)$ |
|
|
155
|
+
| **22** | LC Branch and Bound | State Space Search | `LC - Delivery` | $O(n! \cdot n^2)$ |
|
|
156
|
+
| **23** | LC Branch and Bound | State Space Search | `LC - Flight` | $O(n! \cdot n^2)$ |
|
|
157
|
+
| **24** | LC Branch and Bound | State Space Search | `LC - Drilling` | $O(n! \cdot n^2)$ |
|
|
155
158
|
|
|
156
159
|
---
|
|
157
160
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dancealgorithm"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "DanceAlgorithm: Instant DAA Algorithms, Lab Problem Sheets, Datasets, and Code Vault."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -59,6 +59,8 @@ dancealgorithm = [
|
|
|
59
59
|
"**/*.pyo",
|
|
60
60
|
"**/*.class"
|
|
61
61
|
]
|
|
62
|
-
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
63
65
|
|
|
64
66
|
|
|
@@ -9,7 +9,7 @@ import sys
|
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
from typing import Any, Dict, List, Optional, Union
|
|
11
11
|
|
|
12
|
-
__version__ = "0.1.
|
|
12
|
+
__version__ = "0.1.2"
|
|
13
13
|
|
|
14
14
|
# Import bundled assignments registry and sheets
|
|
15
15
|
from dancealgorithm.assignments import ASSIGNMENTS_DIR, REGISTRY, SHEETS
|
|
@@ -34,8 +34,8 @@ for sheet in SHEETS:
|
|
|
34
34
|
|
|
35
35
|
def get(identifier: Union[int, str]) -> Any:
|
|
36
36
|
"""
|
|
37
|
-
Get a specific problem sheet module by number (1..
|
|
38
|
-
or keyword/name (e.g. 'Customer', 'MS - Customer', '
|
|
37
|
+
Get a specific problem sheet module by number (1..18), ID (e.g. 'ps1', 'PS01'),
|
|
38
|
+
or keyword/name (e.g. 'Customer', 'MS - Customer', 'MSG - Logistics').
|
|
39
39
|
"""
|
|
40
40
|
if identifier in REGISTRY:
|
|
41
41
|
return REGISTRY[identifier]
|
|
@@ -57,7 +57,7 @@ def get(identifier: Union[int, str]) -> Any:
|
|
|
57
57
|
if norm in clean_title or clean_title in norm:
|
|
58
58
|
return sheet
|
|
59
59
|
|
|
60
|
-
raise KeyError(f"Problem sheet not found for '{identifier}'. Available: 1..
|
|
60
|
+
raise KeyError(f"Problem sheet not found for '{identifier}'. Available: 1..18.")
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
# Convenience alias: dancealgorithm.ps(1)
|
|
@@ -86,7 +86,7 @@ def extract(
|
|
|
86
86
|
) -> List[Path]:
|
|
87
87
|
"""
|
|
88
88
|
Extract all problem sheets or a specific one to the destination directory.
|
|
89
|
-
Default destination is C:\\DAA_Assignments (or ~/DAA_Assignments).
|
|
89
|
+
Default destination is C:\\DAA_Assignments on Windows (or ~/DAA_Assignments on Linux).
|
|
90
90
|
"""
|
|
91
91
|
from dancealgorithm.config import get_destination
|
|
92
92
|
from dancealgorithm.downloader import extract_bundled
|
|
@@ -98,13 +98,18 @@ def extract(
|
|
|
98
98
|
|
|
99
99
|
def open_folder(destination: Optional[Union[str, Path]] = None) -> None:
|
|
100
100
|
"""
|
|
101
|
-
Open the assignments destination folder in
|
|
101
|
+
Open the assignments destination folder in the default system file manager.
|
|
102
|
+
Works seamlessly on Windows (explorer), macOS (open), and Linux (xdg-open).
|
|
102
103
|
"""
|
|
103
104
|
from dancealgorithm.config import get_destination
|
|
104
105
|
target = Path(destination) if destination else get_destination()
|
|
105
106
|
target.mkdir(parents=True, exist_ok=True)
|
|
106
107
|
if sys.platform == "win32":
|
|
107
108
|
os.system(f'explorer "{target}"')
|
|
109
|
+
elif sys.platform == "darwin":
|
|
110
|
+
os.system(f'open "{target}"')
|
|
111
|
+
else:
|
|
112
|
+
os.system(f'xdg-open "{target}" 2>/dev/null &')
|
|
108
113
|
|
|
109
114
|
|
|
110
115
|
def __getattr__(name: str) -> Any:
|
|
@@ -123,6 +128,4 @@ __all__ = [
|
|
|
123
128
|
"extract",
|
|
124
129
|
"open_folder",
|
|
125
130
|
]
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
|
{dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA - Campus/__init__.py
RENAMED
|
@@ -25,6 +25,10 @@ def open_folder() -> None:
|
|
|
25
25
|
import os
|
|
26
26
|
if sys.platform == "win32":
|
|
27
27
|
os.system(f'explorer "{PATH}"')
|
|
28
|
+
elif sys.platform == "darwin":
|
|
29
|
+
os.system(f'open "{PATH}"')
|
|
30
|
+
else:
|
|
31
|
+
os.system(f'xdg-open "{PATH}" 2>/dev/null &')
|
|
28
32
|
|
|
29
33
|
def __getattr__(name: str):
|
|
30
34
|
if name in ("code", "java_code", "solution_code"):
|
{dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA - Flight/__init__.py
RENAMED
|
@@ -25,6 +25,10 @@ def open_folder() -> None:
|
|
|
25
25
|
import os
|
|
26
26
|
if sys.platform == "win32":
|
|
27
27
|
os.system(f'explorer "{PATH}"')
|
|
28
|
+
elif sys.platform == "darwin":
|
|
29
|
+
os.system(f'open "{PATH}"')
|
|
30
|
+
else:
|
|
31
|
+
os.system(f'xdg-open "{PATH}" 2>/dev/null &')
|
|
28
32
|
|
|
29
33
|
def __getattr__(name: str):
|
|
30
34
|
if name in ("code", "java_code", "solution_code"):
|
{dancealgorithm-0.1.0 → dancealgorithm-0.1.2}/src/dancealgorithm/assignments/DA - Smart/__init__.py
RENAMED
|
@@ -25,6 +25,10 @@ def open_folder() -> None:
|
|
|
25
25
|
import os
|
|
26
26
|
if sys.platform == "win32":
|
|
27
27
|
os.system(f'explorer "{PATH}"')
|
|
28
|
+
elif sys.platform == "darwin":
|
|
29
|
+
os.system(f'open "{PATH}"')
|
|
30
|
+
else:
|
|
31
|
+
os.system(f'xdg-open "{PATH}" 2>/dev/null &')
|
|
28
32
|
|
|
29
33
|
def __getattr__(name: str):
|
|
30
34
|
if name in ("code", "java_code", "solution_code"):
|
|
@@ -25,6 +25,10 @@ def open_folder() -> None:
|
|
|
25
25
|
import os
|
|
26
26
|
if sys.platform == "win32":
|
|
27
27
|
os.system(f'explorer "{PATH}"')
|
|
28
|
+
elif sys.platform == "darwin":
|
|
29
|
+
os.system(f'open "{PATH}"')
|
|
30
|
+
else:
|
|
31
|
+
os.system(f'xdg-open "{PATH}" 2>/dev/null &')
|
|
28
32
|
|
|
29
33
|
def __getattr__(name: str):
|
|
30
34
|
if name in ("code", "java_code", "solution_code"):
|
|
@@ -25,6 +25,10 @@ def open_folder() -> None:
|
|
|
25
25
|
import os
|
|
26
26
|
if sys.platform == "win32":
|
|
27
27
|
os.system(f'explorer "{PATH}"')
|
|
28
|
+
elif sys.platform == "darwin":
|
|
29
|
+
os.system(f'open "{PATH}"')
|
|
30
|
+
else:
|
|
31
|
+
os.system(f'xdg-open "{PATH}" 2>/dev/null &')
|
|
28
32
|
|
|
29
33
|
def __getattr__(name: str):
|
|
30
34
|
if name in ("code", "java_code", "solution_code"):
|
|
@@ -25,6 +25,10 @@ def open_folder() -> None:
|
|
|
25
25
|
import os
|
|
26
26
|
if sys.platform == "win32":
|
|
27
27
|
os.system(f'explorer "{PATH}"')
|
|
28
|
+
elif sys.platform == "darwin":
|
|
29
|
+
os.system(f'open "{PATH}"')
|
|
30
|
+
else:
|
|
31
|
+
os.system(f'xdg-open "{PATH}" 2>/dev/null &')
|
|
28
32
|
|
|
29
33
|
def __getattr__(name: str):
|
|
30
34
|
if name in ("code", "java_code", "solution_code"):
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
|
|
2
|
+
import java.util.*;
|
|
3
|
+
|
|
4
|
+
public class Solution {
|
|
5
|
+
// 1. Main Function
|
|
6
|
+
public static void main(String args[]) {
|
|
7
|
+
Scanner sc = new Scanner(System.in);
|
|
8
|
+
|
|
9
|
+
System.out.print("Enter number of lectures: ");
|
|
10
|
+
int iSize = sc.nextInt();
|
|
11
|
+
|
|
12
|
+
String sLectures[] = new String[iSize];
|
|
13
|
+
|
|
14
|
+
// 2. Get Lecture Details
|
|
15
|
+
sc.nextLine();
|
|
16
|
+
|
|
17
|
+
for (int iCnt = 0; iCnt < iSize; iCnt++) {
|
|
18
|
+
System.out.print("Enter lecture " + (iCnt + 1) + ": ");
|
|
19
|
+
sLectures[iCnt] = sc.nextLine();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 3. Create Conflict Graph
|
|
23
|
+
int iGraph[][] = new int[iSize][iSize];
|
|
24
|
+
|
|
25
|
+
System.out.print("Enter number of conflict pairs: ");
|
|
26
|
+
int iPairs = sc.nextInt();
|
|
27
|
+
|
|
28
|
+
for (int iCnt = 0; iCnt < iPairs; iCnt++) {
|
|
29
|
+
System.out.println("\nEnter lecture numbers for conflict pair " + (iCnt + 1));
|
|
30
|
+
|
|
31
|
+
System.out.print("First lecture: ");
|
|
32
|
+
int iU = sc.nextInt() - 1;
|
|
33
|
+
|
|
34
|
+
System.out.print("Second lecture: ");
|
|
35
|
+
int iV = sc.nextInt() - 1;
|
|
36
|
+
|
|
37
|
+
if (iU >= 0 && iU < iSize && iV >= 0 &&
|
|
38
|
+
iV < iSize && iU != iV) {
|
|
39
|
+
iGraph[iU][iV] = 1;
|
|
40
|
+
iGraph[iV][iU] = 1;
|
|
41
|
+
} else {
|
|
42
|
+
System.out.println("Invalid lecture numbers!");
|
|
43
|
+
iCnt--;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 4. Get Available Classrooms
|
|
48
|
+
System.out.print("\nEnter available classrooms: ");
|
|
49
|
+
int iRooms = sc.nextInt();
|
|
50
|
+
|
|
51
|
+
// 5. Apply Graph Coloring
|
|
52
|
+
ClassroomScheduler(iGraph, iRooms, sLectures);
|
|
53
|
+
|
|
54
|
+
sc.close();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 6. Check Whether Color Is Safe
|
|
58
|
+
static boolean IsSafe(int iV, int iGraph[][],
|
|
59
|
+
int iColor[], int iC, int iSize) {
|
|
60
|
+
for (int iCnt = 0; iCnt < iSize; iCnt++) {
|
|
61
|
+
if (iGraph[iV][iCnt] == 1 && iColor[iCnt] == iC) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 7. Graph Coloring Using Backtracking
|
|
70
|
+
static boolean GraphColoring(int iGraph[][], int iRooms,
|
|
71
|
+
int iColor[], int iV, int iSize) {
|
|
72
|
+
if (iV == iSize) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
for (int iC = 1; iC <= iRooms; iC++) {
|
|
77
|
+
if (IsSafe(iV, iGraph, iColor, iC, iSize)) {
|
|
78
|
+
iColor[iV] = iC;
|
|
79
|
+
|
|
80
|
+
if (GraphColoring(iGraph, iRooms, iColor,
|
|
81
|
+
iV + 1, iSize)) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Backtrack
|
|
86
|
+
iColor[iV] = 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 8. Classroom Scheduler
|
|
94
|
+
static void ClassroomScheduler(int iGraph[][],
|
|
95
|
+
int iRooms, String sLectures[]) {
|
|
96
|
+
int iSize = sLectures.length;
|
|
97
|
+
int iColor[] = new int[iSize];
|
|
98
|
+
|
|
99
|
+
System.out.println("\nClassroom Allocation:");
|
|
100
|
+
System.out.println("------------------------------------------------");
|
|
101
|
+
|
|
102
|
+
if (!GraphColoring(iGraph, iRooms, iColor, 0, iSize)) {
|
|
103
|
+
System.out.println("Cannot schedule all lectures without conflicts!");
|
|
104
|
+
} else {
|
|
105
|
+
System.out.printf("%-35s %-20s%n",
|
|
106
|
+
"Lecture Session", "Allocated Classroom");
|
|
107
|
+
|
|
108
|
+
System.out.println("------------------------------------------------");
|
|
109
|
+
|
|
110
|
+
for (int iCnt = 0; iCnt < iSize; iCnt++) {
|
|
111
|
+
System.out.printf("%-35s Room Hall %d%n",
|
|
112
|
+
sLectures[iCnt], iColor[iCnt]);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
System.out.println("------------------------------------------------");
|
|
116
|
+
System.out.println("Status: All lectures scheduled without conflicts.");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -25,6 +25,10 @@ def open_folder() -> None:
|
|
|
25
25
|
import os
|
|
26
26
|
if sys.platform == "win32":
|
|
27
27
|
os.system(f'explorer "{PATH}"')
|
|
28
|
+
elif sys.platform == "darwin":
|
|
29
|
+
os.system(f'open "{PATH}"')
|
|
30
|
+
else:
|
|
31
|
+
os.system(f'xdg-open "{PATH}" 2>/dev/null &')
|
|
28
32
|
|
|
29
33
|
def __getattr__(name: str):
|
|
30
34
|
if name in ("code", "java_code", "solution_code"):
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
|
|
2
|
+
import java.util.*;
|
|
3
|
+
|
|
4
|
+
public class Solution {
|
|
5
|
+
// 1. Main Function
|
|
6
|
+
public static void main(String args[]) {
|
|
7
|
+
Scanner sc = new Scanner(System.in);
|
|
8
|
+
|
|
9
|
+
System.out.print("Enter number of towers: ");
|
|
10
|
+
int iSize = sc.nextInt();
|
|
11
|
+
|
|
12
|
+
String sTowers[] = new String[iSize];
|
|
13
|
+
|
|
14
|
+
// 2. Get Tower Names
|
|
15
|
+
sc.nextLine();
|
|
16
|
+
|
|
17
|
+
for (int iCnt = 0; iCnt < iSize; iCnt++) {
|
|
18
|
+
System.out.print("Enter tower " + (iCnt + 1) + ": ");
|
|
19
|
+
sTowers[iCnt] = sc.nextLine();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 3. Create Interference Graph
|
|
23
|
+
int iGraph[][] = new int[iSize][iSize];
|
|
24
|
+
|
|
25
|
+
System.out.print("Enter number of interference pairs: ");
|
|
26
|
+
int iPairs = sc.nextInt();
|
|
27
|
+
|
|
28
|
+
for (int iCnt = 0; iCnt < iPairs; iCnt++) {
|
|
29
|
+
System.out.println("\nEnter tower numbers for interference pair " + (iCnt + 1));
|
|
30
|
+
|
|
31
|
+
System.out.print("First tower: ");
|
|
32
|
+
int iU = sc.nextInt() - 1;
|
|
33
|
+
|
|
34
|
+
System.out.print("Second tower: ");
|
|
35
|
+
int iV = sc.nextInt() - 1;
|
|
36
|
+
|
|
37
|
+
if (iU >= 0 && iU < iSize && iV >= 0 &&
|
|
38
|
+
iV < iSize && iU != iV) {
|
|
39
|
+
iGraph[iU][iV] = 1;
|
|
40
|
+
iGraph[iV][iU] = 1;
|
|
41
|
+
} else {
|
|
42
|
+
System.out.println("Invalid tower numbers!");
|
|
43
|
+
iCnt--;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 4. Get Available Frequency Channels
|
|
48
|
+
System.out.print("\nEnter available frequency channels: ");
|
|
49
|
+
int iChannels = sc.nextInt();
|
|
50
|
+
|
|
51
|
+
// 5. Apply Graph Coloring
|
|
52
|
+
FrequencyAllocator(iGraph, iChannels, sTowers);
|
|
53
|
+
|
|
54
|
+
sc.close();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 6. Check Whether Color Is Safe
|
|
58
|
+
static boolean IsSafe(int iV, int iGraph[][],
|
|
59
|
+
int iColor[], int iC, int iSize) {
|
|
60
|
+
for (int iCnt = 0; iCnt < iSize; iCnt++) {
|
|
61
|
+
if (iGraph[iV][iCnt] == 1 && iColor[iCnt] == iC) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 7. Graph Coloring Using Backtracking
|
|
70
|
+
static boolean GraphColoring(int iGraph[][], int iChannels,
|
|
71
|
+
int iColor[], int iV, int iSize) {
|
|
72
|
+
if (iV == iSize) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
for (int iC = 1; iC <= iChannels; iC++) {
|
|
77
|
+
if (IsSafe(iV, iGraph, iColor, iC, iSize)) {
|
|
78
|
+
iColor[iV] = iC;
|
|
79
|
+
|
|
80
|
+
if (GraphColoring(iGraph, iChannels, iColor,
|
|
81
|
+
iV + 1, iSize)) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Backtrack
|
|
86
|
+
iColor[iV] = 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 8. Frequency Allocator
|
|
94
|
+
static void FrequencyAllocator(int iGraph[][],
|
|
95
|
+
int iChannels, String sTowers[]) {
|
|
96
|
+
int iSize = sTowers.length;
|
|
97
|
+
int iColor[] = new int[iSize];
|
|
98
|
+
|
|
99
|
+
System.out.println("\nCellular Network Frequency Allocation:");
|
|
100
|
+
System.out.println("---------------------------------------------------------------");
|
|
101
|
+
|
|
102
|
+
if (!GraphColoring(iGraph, iChannels, iColor, 0, iSize)) {
|
|
103
|
+
System.out.println("Cannot allocate frequencies without interference!");
|
|
104
|
+
} else {
|
|
105
|
+
System.out.printf("%-28s %-20s%n",
|
|
106
|
+
"Cellular Tower", "Frequency Channel");
|
|
107
|
+
|
|
108
|
+
System.out.println("---------------------------------------------------------------");
|
|
109
|
+
|
|
110
|
+
for (int iCnt = 0; iCnt < iSize; iCnt++) {
|
|
111
|
+
System.out.printf("%-28s Channel %d (Band %d MHz)%n",
|
|
112
|
+
sTowers[iCnt], iColor[iCnt],
|
|
113
|
+
800 + iColor[iCnt] * 50);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
System.out.println("---------------------------------------------------------------");
|
|
117
|
+
System.out.println("Status: All towers allocated without interference.");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -25,6 +25,10 @@ def open_folder() -> None:
|
|
|
25
25
|
import os
|
|
26
26
|
if sys.platform == "win32":
|
|
27
27
|
os.system(f'explorer "{PATH}"')
|
|
28
|
+
elif sys.platform == "darwin":
|
|
29
|
+
os.system(f'open "{PATH}"')
|
|
30
|
+
else:
|
|
31
|
+
os.system(f'xdg-open "{PATH}" 2>/dev/null &')
|
|
28
32
|
|
|
29
33
|
def __getattr__(name: str):
|
|
30
34
|
if name in ("code", "java_code", "solution_code"):
|