dancealgorithm 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

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.
Files changed (43) hide show
  1. dancealgorithm/__init__.py +12 -9
  2. dancealgorithm/__main__.py +1 -0
  3. dancealgorithm/assignments/DA - Campus/__init__.py +4 -0
  4. dancealgorithm/assignments/DA - Flight/__init__.py +4 -0
  5. dancealgorithm/assignments/DA - Smart/__init__.py +4 -0
  6. dancealgorithm/assignments/FK - Advertisement/__init__.py +4 -0
  7. dancealgorithm/assignments/FK - Electric/__init__.py +4 -0
  8. dancealgorithm/assignments/FK - Emergency/__init__.py +4 -0
  9. dancealgorithm/assignments/K - Cloud/__init__.py +4 -0
  10. dancealgorithm/assignments/K - Disaster/__init__.py +4 -0
  11. dancealgorithm/assignments/K - Hospital/__init__.py +4 -0
  12. dancealgorithm/assignments/MS - Commerce/__init__.py +4 -0
  13. dancealgorithm/assignments/MS - Customer/__init__.py +4 -0
  14. dancealgorithm/assignments/MS - Library/__init__.py +4 -0
  15. dancealgorithm/assignments/MSG - Emergency/__init__.py +4 -0
  16. dancealgorithm/assignments/MSG - Logistics/__init__.py +4 -0
  17. dancealgorithm/assignments/MSG - Skyconnect/__init__.py +4 -0
  18. dancealgorithm/assignments/QS - Commerce/__init__.py +4 -0
  19. dancealgorithm/assignments/QS - Movie/__init__.py +4 -0
  20. dancealgorithm/assignments/QS - Online/__init__.py +4 -0
  21. dancealgorithm/assignments/__init__.py +19 -25
  22. dancealgorithm/downloader.py +1 -7
  23. {dancealgorithm-0.1.0.dist-info → dancealgorithm-0.1.1.dist-info}/METADATA +10 -22
  24. dancealgorithm-0.1.1.dist-info/RECORD +60 -0
  25. dancealgorithm/assignments/GC - Classroom/Solution.java +0 -87
  26. dancealgorithm/assignments/GC - Classroom/__init__.py +0 -34
  27. dancealgorithm/assignments/GC - Interference/Solution.java +0 -88
  28. dancealgorithm/assignments/GC - Interference/__init__.py +0 -34
  29. dancealgorithm/assignments/GC - University/Solution.java +0 -88
  30. dancealgorithm/assignments/GC - University/__init__.py +0 -34
  31. dancealgorithm/assignments/GC.txt +0 -25
  32. dancealgorithm/assignments/LC - Delivery/Solution.java +0 -180
  33. dancealgorithm/assignments/LC - Delivery/__init__.py +0 -34
  34. dancealgorithm/assignments/LC - Drilling/Solution.java +0 -197
  35. dancealgorithm/assignments/LC - Drilling/__init__.py +0 -34
  36. dancealgorithm/assignments/LC - Flight/Solution.java +0 -180
  37. dancealgorithm/assignments/LC - Flight/__init__.py +0 -34
  38. dancealgorithm/assignments/LC.txt +0 -31
  39. dancealgorithm-0.1.0.dist-info/RECORD +0 -74
  40. {dancealgorithm-0.1.0.dist-info → dancealgorithm-0.1.1.dist-info}/WHEEL +0 -0
  41. {dancealgorithm-0.1.0.dist-info → dancealgorithm-0.1.1.dist-info}/entry_points.txt +0 -0
  42. {dancealgorithm-0.1.0.dist-info → dancealgorithm-0.1.1.dist-info}/licenses/LICENSE +0 -0
  43. {dancealgorithm-0.1.0.dist-info → dancealgorithm-0.1.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  """
2
2
  DanceAlgorithm - Instant DAA Algorithms, Lab Problem Sheets, Datasets & Code Vault.
3
- All 24 Practical Exam Problem Sheets & Algorithm Notes Bundled & Instantly Importable.
3
+ All 18 Practical Exam Problem Sheets & Algorithm Notes Bundled & Instantly Importable.
4
4
  """
5
5
  from __future__ import annotations
6
6
 
@@ -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.0"
12
+ __version__ = "0.1.1"
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..24), ID (e.g. 'ps1', 'PS01'),
38
- or keyword/name (e.g. 'Customer', 'MS - Customer', 'GC - Classroom').
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..24.")
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 Windows File Explorer.
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:
@@ -124,5 +129,3 @@ __all__ = [
124
129
  "open_folder",
125
130
  ]
126
131
 
127
-
128
-
@@ -6,3 +6,4 @@ from dancealgorithm.cli import main
6
6
 
7
7
  if __name__ == "__main__":
8
8
  sys.exit(main())
9
+
@@ -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"):
@@ -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"):
@@ -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"):
@@ -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"):
@@ -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"):
@@ -1,6 +1,6 @@
1
1
  """
2
2
  DanceAlgorithm Bundled Problem Sheets & Assignments Vault.
3
- Contains all 24 DAA algorithms and problem sheets.
3
+ Contains all 18 DAA algorithms and problem sheets from DAA_UPDATED_PIP.
4
4
  """
5
5
  from __future__ import annotations
6
6
 
@@ -15,30 +15,24 @@ SHEETS: List[Any] = []
15
15
  DAA_ASSIGNMENTS: Dict[str, Any] = {}
16
16
 
17
17
  ORDERED_NAMES = [
18
- "MS - Customer",
19
- "MS - Commerce",
20
- "MS - Library",
21
- "QS - Movie",
22
- "QS - Commerce",
23
- "QS - Online",
24
- "FK - Emergency",
25
- "FK - Electric",
26
- "FK - Advertisement",
27
- "DA - Smart",
28
- "DA - Campus",
29
- "DA - Flight",
30
- "MSG - Logistics",
31
- "MSG - Skyconnect",
32
- "MSG - Emergency",
33
- "K - Disaster",
34
- "K - Hospital",
35
- "K - Cloud",
36
- "GC - Classroom",
37
- "GC - Interference",
38
- "GC - University",
39
- "LC - Delivery",
40
- "LC - Drilling",
41
- "LC - Flight",
18
+ "MS - Customer", # 1
19
+ "MS - Commerce", # 2
20
+ "MS - Library", # 3
21
+ "QS - Movie", # 4
22
+ "QS - Commerce", # 5
23
+ "QS - Online", # 6
24
+ "FK - Emergency", # 7
25
+ "FK - Electric", # 8
26
+ "FK - Advertisement", # 9
27
+ "DA - Smart", # 10
28
+ "DA - Campus", # 11
29
+ "DA - Flight", # 12
30
+ "MSG - Logistics", # 13
31
+ "MSG - Skyconnect", # 14
32
+ "MSG - Emergency", # 15
33
+ "K - Disaster", # 16
34
+ "K - Hospital", # 17
35
+ "K - Cloud", # 18
42
36
  ]
43
37
 
44
38
  for idx, name in enumerate(ORDERED_NAMES, 1):
@@ -15,7 +15,7 @@ import zipfile
15
15
  from pathlib import Path
16
16
  from typing import Dict, List, Optional, Tuple
17
17
 
18
- USER_AGENT = "DanceAlgorithm-CLI/0.1.0"
18
+ USER_AGENT = "DanceAlgorithm-CLI/0.1.1"
19
19
  MAX_ARCHIVE_SIZE_BYTES = 300 * 1024 * 1024 # 300 MB limit
20
20
  MAX_FILE_COUNT = 10000 # 10,000 files limit
21
21
 
@@ -40,12 +40,6 @@ ORDERED_ASSIGNMENTS = [
40
40
  "K - Disaster", # 16
41
41
  "K - Hospital", # 17
42
42
  "K - Cloud", # 18
43
- "GC - Classroom", # 19
44
- "GC - Interference", # 20
45
- "GC - University", # 21
46
- "LC - Delivery", # 22
47
- "LC - Drilling", # 23
48
- "LC - Flight", # 24
49
43
  ]
50
44
 
51
45
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dancealgorithm
3
- Version: 0.1.0
3
+ Version: 0.1.1
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 18 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
  [![PyPI Version](https://img.shields.io/pypi/v/dancealgorithm.svg)](https://pypi.org/project/dancealgorithm/)
32
32
  [![Python Version](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org/)
33
+ [![OS: Windows & Linux](https://img.shields.io/badge/OS-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)]()
33
34
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
34
35
  [![Zero Dependencies](https://img.shields.io/badge/dependencies-0%20runtime-brightgreen.svg)]()
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 to `C:\DAA_Assignments`
41
+ ### Option A: Install & Extract All 18 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 18 problem sheets:
53
54
 
54
55
  ```text
55
56
  C:\DAA_Assignments\
@@ -61,7 +62,7 @@ C:\DAA_Assignments\
61
62
  │ └── Solution.java
62
63
  ├── MS - Library/
63
64
  ├── ...
64
- └── LC - Flight/
65
+ └── K - Cloud/
65
66
  └── Solution.java
66
67
  ```
67
68
 
@@ -83,9 +84,6 @@ dance QS.txt
83
84
  # Dijkstra shortest path analysis
84
85
  dance DA.txt
85
86
 
86
- # Graph Coloring backtracking analysis
87
- dance GC.txt
88
-
89
87
  # Fractional Knapsack greedy proof
90
88
  dance FK.txt
91
89
 
@@ -94,9 +92,6 @@ dance K.txt
94
92
 
95
93
  # Multistage Graph backward DP
96
94
  dance MSG.txt
97
-
98
- # Least Cost Branch & Bound TSP
99
- dance LC.txt
100
95
  ```
101
96
 
102
97
  *(You can also use `dancealgorithm DA.txt` or `dance DA`)*
@@ -109,13 +104,12 @@ Extract only that particular folder:
109
104
  # Extract unquoted or quoted
110
105
  dance MSG - Logistics
111
106
  dance "DA - Smart"
112
- dance "GC - Classroom"
113
107
  dance "MS - Customer"
114
108
 
115
109
  # Or extract by problem number
116
110
  dance 1
111
+ dance 10
117
112
  dance 13
118
- dance 19
119
113
  ```
120
114
 
121
115
  ### 3. List All Available Problem Sheets & Notes
@@ -128,7 +122,7 @@ dance list
128
122
 
129
123
  ## 🐍 Option B: Direct Python Import
130
124
 
131
- All 24 assignments can be directly inspected or extracted programmatically:
125
+ All 18 assignments can be directly inspected or extracted programmatically:
132
126
 
133
127
  ```python
134
128
  import dancealgorithm
@@ -143,13 +137,13 @@ dancealgorithm.extract("MSG - Logistics")
143
137
  # 3. Extract all sheets to custom destination
144
138
  dancealgorithm.extract(destination="D:/MyLabs")
145
139
 
146
- # 4. Open destination folder in Windows Explorer
140
+ # 4. Open destination folder in system file manager (Windows, Linux, macOS)
147
141
  dancealgorithm.open_folder()
148
142
  ```
149
143
 
150
144
  ---
151
145
 
152
- ## 📚 Complete Catalogue of All 24 DAA Problem Sheets
146
+ ## 📚 Complete Catalogue of All 18 DAA Problem Sheets
153
147
 
154
148
  | No. | Algorithm | Category | Problem Sheet Title | Time Complexity |
155
149
  |---|---|---|---|---|
@@ -171,12 +165,6 @@ dancealgorithm.open_folder()
171
165
  | **16** | 0/1 Knapsack | Dynamic Programming | `K - Disaster` | $O(n \cdot W)$ |
172
166
  | **17** | 0/1 Knapsack | Dynamic Programming | `K - Hospital` | $O(n \cdot W)$ |
173
167
  | **18** | 0/1 Knapsack | Dynamic Programming | `K - Cloud` | $O(n \cdot W)$ |
174
- | **19** | Graph Coloring | Backtracking | `GC - Classroom` | $O(V \cdot m^V)$ |
175
- | **20** | Graph Coloring | Backtracking | `GC - Interference` | $O(V \cdot m^V)$ |
176
- | **21** | Graph Coloring | Backtracking | `GC - University` | $O(V \cdot m^V)$ |
177
- | **22** | LC Branch & Bound | Branch & Bound | `LC - Delivery` | $O(n! \cdot n^2)$ |
178
- | **23** | LC Branch & Bound | Branch & Bound | `LC - Drilling` | $O(n! \cdot n^2)$ |
179
- | **24** | LC Branch & Bound | Branch & Bound | `LC - Flight` | $O(n! \cdot n^2)$ |
180
168
 
181
169
  ---
182
170
 
@@ -0,0 +1,60 @@
1
+ dancealgorithm/__init__.py,sha256=JDRvQumu3ekC5qZ5gKNdUqkWc3k_xD1hDR7x8o7C-j8,4103
2
+ dancealgorithm/__main__.py,sha256=o7NdtuZ8z0YCl_VHH-K-ScUaLzsEF-aJvBhEE83e_bA,147
3
+ dancealgorithm/cli.py,sha256=c8iLHbPfxXj7nByjj6S07rPP87nJZHjcWKBITOBRkKY,11400
4
+ dancealgorithm/config.py,sha256=DkKqK5KzWarrffRgOBXNMcP-6WO0plH7sWgRtJ_Clog,3469
5
+ dancealgorithm/downloader.py,sha256=3mrtpw9xyVwH01UdsaL3-K2fbLOtH8ntQcKvjecSHoM,10662
6
+ dancealgorithm/assignments/DA.txt,sha256=ApbF0CgOHjkxpu1U3mz9eKAFmms4YQTCIXSCI0tmGHY,821
7
+ dancealgorithm/assignments/FK.txt,sha256=jkYwT6a9kHoLBGlqY49johxZ5nZ7hFvLB4rhO5Ta6Yc,677
8
+ dancealgorithm/assignments/K.txt,sha256=z_qzBXO6X_6-X8giUxMyPiJMzPKQHvzsLCd43gZ6RQM,881
9
+ dancealgorithm/assignments/MS.txt,sha256=quWqxFLWwj1gI36ZiOHdOrlO5Ld4Lf6M6Z5BaLq8m84,773
10
+ dancealgorithm/assignments/MSG.txt,sha256=qAuQRPFpXe-mLN-RkPWRvLwFZg5hQfrxl68W5VQFzfs,785
11
+ dancealgorithm/assignments/QS.txt,sha256=Oca81yUqcWjDqgqG2wuZdeOKIgzocllmqTpdpVpKltg,779
12
+ dancealgorithm/assignments/__init__.py,sha256=_2CLWsvb_6i_S3xF4jTve5CEvMrfGc0h-dh4k89mGUM,1759
13
+ dancealgorithm/assignments/DA - Campus/Solution.java,sha256=PKc8isqiJQgLrf5BcCIorPNC-QtYrEzTaVUupIFFhHs,5958
14
+ dancealgorithm/assignments/DA - Campus/__init__.py,sha256=H1PkcrR0crEc_zXcIx7-13pSJ02U_9F8zm56qzNNlVY,1243
15
+ dancealgorithm/assignments/DA - Flight/Solution.java,sha256=PqZW43eOeqCo6y6gBf42Rs--rNHAlVN7GypaCtvKz8w,6165
16
+ dancealgorithm/assignments/DA - Flight/__init__.py,sha256=IDfBPry9ahTQb2VyB57zJm7qjqshcTYDsDtKG8npSwk,1243
17
+ dancealgorithm/assignments/DA - Smart/Solution.java,sha256=rhYrq6UQMKKZ1BJ11agqgX2gSHJmS1_Gm3VDsKhDx4o,6602
18
+ dancealgorithm/assignments/DA - Smart/__init__.py,sha256=O4yQmUOW-V8X-zzAyFZ3xo8YlywdDfQqAIZ2di4-qyE,1242
19
+ dancealgorithm/assignments/FK - Advertisement/Solution.java,sha256=hWMEEfEEsOtVcZ6WGANoDatI9fCwTEsrUOX8CHxDWn4,4116
20
+ dancealgorithm/assignments/FK - Advertisement/__init__.py,sha256=isFzxcgy_RO0MPrb-wXejaz7Wg1_aTUISxptWHfYEzA,1250
21
+ dancealgorithm/assignments/FK - Electric/Solution.java,sha256=McdzpMtwOj7nogM2Dvs0D9VQjB9yNz-NfWpCHfRHJ3A,4919
22
+ dancealgorithm/assignments/FK - Electric/__init__.py,sha256=ukfnlChm799GNbKwvOyvVH9XEBTIy8ZfoHbXmyb091E,1245
23
+ dancealgorithm/assignments/FK - Emergency/Solution.java,sha256=VpDI36p3nvDmAgxCuAAouwe60U0m4GlPoWr1f3OLUJU,4376
24
+ dancealgorithm/assignments/FK - Emergency/__init__.py,sha256=wW1nKieoGoEEqg_H4W6nunhzmJmJym8SMf0Dt0P43Lk,1246
25
+ dancealgorithm/assignments/K - Cloud/Solution.java,sha256=YxfVvtj1z-oEnCJGLE9KW5piqOXXq-UyFY-Cw7rb4pQ,3651
26
+ dancealgorithm/assignments/K - Cloud/__init__.py,sha256=9phRVy-jlOjNDVtFLztYcP2FwIiRaeiHFaPl2haNM44,1241
27
+ dancealgorithm/assignments/K - Disaster/Solution.java,sha256=MEtGgOqiwP9oWPnDszLGudaytwasHmcKlUp3utMcPl4,3647
28
+ dancealgorithm/assignments/K - Disaster/__init__.py,sha256=yMf72b6rZmC_KytRvo3lRT7blYagOS6Owi6COLTlGfA,1244
29
+ dancealgorithm/assignments/K - Hospital/Solution.java,sha256=LrvcnmmErFjBs6y29e42JsIuu4JnZElFP3s-fTaAy7o,3737
30
+ dancealgorithm/assignments/K - Hospital/__init__.py,sha256=zLAICmZYB3VbovKbQYNCfn-n59HcGeeLYneXpEu_NYA,1244
31
+ dancealgorithm/assignments/MS - Commerce/Solution.java,sha256=KZlxjeT0Zw1I06SnfsEfM5GJ-HFs8j4y5Nuoe5YaMmw,4457
32
+ dancealgorithm/assignments/MS - Commerce/__init__.py,sha256=zUTiYHn2ZC1xr5yvpgdYob5Fkj8_5pYbauC-56UZhkw,1245
33
+ dancealgorithm/assignments/MS - Commerce/dataset.csv,sha256=zi5vDgC45LcQUMUumAJd1e7bUludJe6MtfI713BxCIY,720
34
+ dancealgorithm/assignments/MS - Customer/Solution.java,sha256=K4e3VgAbxIPT1FIw4QHxi7kXKiGX7CXFdCu2gJKhefA,3762
35
+ dancealgorithm/assignments/MS - Customer/__init__.py,sha256=aDT9IL0mwecc4rkXN063ENUsruZihwgohvY57ywz108,1245
36
+ dancealgorithm/assignments/MS - Customer/dataset.csv,sha256=RTEtOyoQPfL1sqCMiKY9gUs0LJfCPCKRtUaDddYOcvU,725
37
+ dancealgorithm/assignments/MS - Library/Solution.java,sha256=MlYVSxeMhB229rKGi_P2amtPpiTAKLrwnBEbn82jZnk,4214
38
+ dancealgorithm/assignments/MS - Library/__init__.py,sha256=tctXnJemIWPjwbsnmVXHBYljYK1fQnMqYFUMDMDOlD4,1244
39
+ dancealgorithm/assignments/MS - Library/dataset.csv,sha256=9qfxa3ipUxro7csXuEir0vnaOjeygrB4uhqYDgEI1sc,809
40
+ dancealgorithm/assignments/MSG - Emergency/Solution.java,sha256=218ZsZD1Jt8aeSOL4CGuYHTzQopCB9k8sJRKHU3M8I8,6347
41
+ dancealgorithm/assignments/MSG - Emergency/__init__.py,sha256=-9uuLeQU5ZFdt_G1E-bm6lAqFJ9wnicY2NkHRv1UjSY,1247
42
+ dancealgorithm/assignments/MSG - Logistics/Solution.java,sha256=m-H-p4oA_tiB0xfKahqfeVPkyUCTpw0499_pl6rp3Og,5167
43
+ dancealgorithm/assignments/MSG - Logistics/__init__.py,sha256=3BuggtH2pqBWewJ-sCQcQ7kdn5aKyF5LjQ44eSzVqf8,1247
44
+ dancealgorithm/assignments/MSG - Skyconnect/Solution.java,sha256=uOToRaiothqxh8CwtRMbDcAkHSloSx3_TXa2FlvNLkQ,5983
45
+ dancealgorithm/assignments/MSG - Skyconnect/__init__.py,sha256=TEEMMOF-umg37rElcxbuRgWmTkKHiQJMraRhY4jnZJY,1248
46
+ dancealgorithm/assignments/QS - Commerce/Solution.java,sha256=K_IXP___lnrGwUuy8jL3EjhMp8XGJLElWsWDkj1VZpY,3898
47
+ dancealgorithm/assignments/QS - Commerce/__init__.py,sha256=YSjbqg5t0udvBUIEvNK8HUWwDAN0jmTOrZfk4pAXhO0,1245
48
+ dancealgorithm/assignments/QS - Commerce/dataset.csv,sha256=_BXt-P7o4DMGM1FZ6Kdm42BmfIj7LbhGZw9L-o5SSxk,634
49
+ dancealgorithm/assignments/QS - Movie/Solution.java,sha256=jhekIeomEkmB6V23gLE00ZxWfHSFoqvyYlzDCiw2ll8,3848
50
+ dancealgorithm/assignments/QS - Movie/__init__.py,sha256=9To6zv7CN5PmRK0Jz21kNQ88InNRvTVkkz4OvoxS9MQ,1242
51
+ dancealgorithm/assignments/QS - Movie/dataset.csv,sha256=rsnfsXCCQWrRfNEB_lUdNWi6W8JKNNwUUZ3B2VFaRXw,480
52
+ dancealgorithm/assignments/QS - Online/Solution.java,sha256=A8bALrw4QDgazRTUKpYZ1nBr1rVXezoFWjnvSQKHk_I,3747
53
+ dancealgorithm/assignments/QS - Online/__init__.py,sha256=6HfCKL8PWcjMerKOJDq6qUglHp5XmvlF-x-YXpRaBfQ,1243
54
+ dancealgorithm/assignments/QS - Online/dataset.csv,sha256=jLrUusfK5fqLRT9ZmJKZPDZ5s2Zw94JixGrKJGoGHNc,631
55
+ dancealgorithm-0.1.1.dist-info/licenses/LICENSE,sha256=eE9Hj40DYTIwVR4OoOhSuK0sijGtFXOK9_atK1Lz6-A,1083
56
+ dancealgorithm-0.1.1.dist-info/METADATA,sha256=smEC6kBtUKAfbyd2RAjHSAEAe0325BbXUrvCR1qbJo0,6004
57
+ dancealgorithm-0.1.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
58
+ dancealgorithm-0.1.1.dist-info/entry_points.txt,sha256=y31VtV8oOHRSQbU5bVTxqQndGGOyRCOaK_Cmd9bUcyI,91
59
+ dancealgorithm-0.1.1.dist-info/top_level.txt,sha256=gst6Jq05KzE4EKbhCzRDSKtchmLdmeYDIqlqry342lM,15
60
+ dancealgorithm-0.1.1.dist-info/RECORD,,
@@ -1,87 +0,0 @@
1
- import java.util.Arrays;
2
-
3
- // Main solution
4
- public class Solution {
5
- // O(V * m^V)
6
-
7
- // Safety check
8
- public static boolean isSafe(int v, int[][] graph, int[] color, int c, int V) {
9
- for (int i = 0; i < V; i++) {
10
- if (graph[v][i] == 1 && color[i] == c) {
11
- return false;
12
- }
13
- }
14
- return true;
15
- }
16
-
17
- // Backtracking search
18
- public static boolean graphColoringUtil(int[][] graph, int m, int[] color, int v, int V) {
19
- if (v == V) {
20
- return true;
21
- }
22
-
23
- for (int c = 1; c <= m; c++) {
24
- if (isSafe(v, graph, color, c, V)) {
25
- color[v] = c;
26
-
27
- if (graphColoringUtil(graph, m, color, v + 1, V)) {
28
- return true;
29
- }
30
-
31
- // Backtrack
32
- color[v] = 0;
33
- }
34
- }
35
- return false;
36
- }
37
-
38
- public static void classroomScheduler(int[][] graph, int m, String[] lectures) {
39
- int V = lectures.length;
40
- int[] color = new int[V];
41
- Arrays.fill(color, 0);
42
-
43
- System.out.println("\nAcademic Classroom Allocation (Conflict-Free Scheduling):");
44
- System.out.println("------------------------------------------------------------------");
45
-
46
- if (!graphColoringUtil(graph, m, color, 0, V)) {
47
- System.out.println("Cannot schedule all lectures with " + m + " classrooms without conflicts.");
48
- } else {
49
- System.out.printf("%-30s %-20s%n", "Lecture Session", "Allocated Classroom");
50
- System.out.println("------------------------------------------------------------------");
51
- for (int i = 0; i < V; i++) {
52
- System.out.printf("%-30s Room Hall %d%n", lectures[i], color[i]);
53
- }
54
- System.out.println("------------------------------------------------------------------");
55
- System.out.println("Status: All lectures scheduled with zero room booking collisions.");
56
- }
57
- }
58
-
59
- // Driver code
60
- public static void main(String[] args) {
61
- System.out.println("=======================================================================");
62
- System.out.println("PS 20: Classroom Scheduling Without Conflicts (Graph Coloring - Java)");
63
- System.out.println("=======================================================================");
64
-
65
- String[] lectures = {
66
- "Physics 101 (9:00 - 10:00 AM)", // 0
67
- "Chemistry 101 (9:30 - 10:30 AM)", // 1
68
- "Math 201 (10:00 - 11:00 AM)", // 2
69
- "Biology 101 (10:30 - 11:30 AM)", // 3
70
- "English 102 (9:00 - 10:30 AM)", // 4
71
- "History 101 (11:00 - 12:00 PM)" // 5
72
- };
73
- int V = lectures.length;
74
-
75
- int[][] conflictGraph = {
76
- {0, 1, 0, 0, 1, 0},
77
- {1, 0, 1, 0, 1, 0},
78
- {0, 1, 0, 1, 1, 0},
79
- {0, 0, 1, 0, 0, 1},
80
- {1, 1, 1, 0, 0, 0},
81
- {0, 0, 0, 1, 0, 0}
82
- };
83
-
84
- int availableClassrooms = 3;
85
- classroomScheduler(conflictGraph, availableClassrooms, lectures);
86
- }
87
- }