oslab / build_deck.py
vedraj1309's picture
feat: Aurora Neural OS v2.6 x86_64 microkernel, white theme GUI, and page replacement research
5ad9f9c verified
Raw History Blame Contribute Delete
38.6 kB
import sys
import os
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.enum.shapes import MSO_SHAPE
def create_deck():
prs = Presentation()
# 16:9 Widescreen dimensions
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
blank_layout = prs.slide_layouts[6] # Blank slide
# Theme Colors
COLOR_PRIMARY = RGBColor(27, 54, 93) # Deep Jain Navy
COLOR_SECONDARY = RGBColor(14, 116, 144) # Tech Cyan/Teal
COLOR_ACCENT = RGBColor(217, 119, 6) # Amber/Gold accent
COLOR_BG_CARD = RGBColor(248, 250, 252) # Ultra-light slate
COLOR_BORDER = RGBColor(203, 213, 225) # Border grey
COLOR_TEXT_DARK = RGBColor(30, 41, 59) # Dark slate
COLOR_TEXT_MUTED = RGBColor(100, 116, 139) # Muted slate
COLOR_WHITE = RGBColor(255, 255, 255)
COLOR_SUCCESS = RGBColor(16, 124, 65) # Emerald green
COLOR_HIGHLIGHT = RGBColor(239, 68, 68) # Coral red
def add_header(slide, title_text, category_text, presenter_text=""):
# Top banner shape
header_box = slide.shapes.add_textbox(Inches(0.8), Inches(0.4), Inches(11.733), Inches(1.1))
tf = header_box.text_frame
tf.word_wrap = True
tf.margin_left = tf.margin_top = tf.margin_right = tf.margin_bottom = 0
# Category pill line
p_cat = tf.paragraphs[0]
p_cat.text = f"MODULE 5: TREES & GRAPH ALGORITHMS | {category_text.upper()}"
p_cat.font.size = Pt(11)
p_cat.font.bold = True
p_cat.font.color.rgb = COLOR_SECONDARY
# Title line
p_title = tf.add_paragraph()
p_title.text = title_text
p_title.font.size = Pt(24)
p_title.font.bold = True
p_title.font.color.rgb = COLOR_PRIMARY
p_title.space_after = Pt(4)
if presenter_text:
# Presenter badge on top right
badge = slide.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, Inches(9.8), Inches(0.45), Inches(2.7), Inches(0.4))
badge.fill.solid()
badge.fill.fore_color.rgb = COLOR_PRIMARY
badge.line.color.rgb = COLOR_PRIMARY
btf = badge.text_frame
btf.vertical_anchor = MSO_ANCHOR.MIDDLE
bp = btf.paragraphs[0]
bp.text = f"🎤 Presenter: {presenter_text}"
bp.alignment = PP_ALIGN.CENTER
bp.font.size = Pt(11)
bp.font.bold = True
bp.font.color.rgb = COLOR_WHITE
# Divider line
line = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, Inches(0.8), Inches(1.5), Inches(11.733), Inches(0.03))
line.fill.solid()
line.fill.fore_color.rgb = COLOR_BORDER
line.line.color.rgb = COLOR_BORDER
def add_card(slide, left, top, width, height, title, content_bullets, icon_bullet="▸", card_bg=COLOR_BG_CARD, border_color=COLOR_BORDER):
card = slide.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, left, top, width, height)
card.fill.solid()
card.fill.fore_color.rgb = card_bg
card.line.color.rgb = border_color
card.line.width = Pt(1.2)
tf = card.text_frame
tf.word_wrap = True
tf.margin_left = Inches(0.25)
tf.margin_right = Inches(0.25)
tf.margin_top = Inches(0.2)
tf.margin_bottom = Inches(0.2)
p_t = tf.paragraphs[0]
p_t.text = title
p_t.font.size = Pt(16)
p_t.font.bold = True
p_t.font.color.rgb = COLOR_PRIMARY
p_t.space_after = Pt(10)
for b in content_bullets:
p = tf.add_paragraph()
p.text = f"{icon_bullet} {b}"
p.font.size = Pt(12)
p.font.color.rgb = COLOR_TEXT_DARK
p.space_after = Pt(6)
def set_notes(slide, notes_text):
notes_slide = slide.notes_slide
tf = notes_slide.notes_text_frame
tf.text = notes_text
# ==========================================
# SLIDE 1: Title Slide
# ==========================================
s1 = prs.slides.add_slide(blank_layout)
# Background card
bg = s1.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, 0, Inches(13.333), Inches(7.5))
bg.fill.solid()
bg.fill.fore_color.rgb = COLOR_PRIMARY
bg.line.fill.background()
# Decorative inner accent box
accent_bar = s1.shapes.add_shape(MSO_SHAPE.RECTANGLE, Inches(1.0), Inches(1.2), Inches(0.15), Inches(5.0))
accent_bar.fill.solid()
accent_bar.fill.fore_color.rgb = COLOR_ACCENT
accent_bar.line.fill.background()
tb = s1.shapes.add_textbox(Inches(1.4), Inches(1.1), Inches(10.8), Inches(5.2))
tf = tb.text_frame
tf.word_wrap = True
p0 = tf.paragraphs[0]
p0.text = "FACULTY OF ENGINEERING AND TECHNOLOGY | JAIN (DEEMED-TO-BE UNIVERSITY)"
p0.font.size = Pt(13)
p0.font.bold = True
p0.font.color.rgb = RGBColor(190, 215, 255)
p0.space_after = Pt(14)
p1 = tf.add_paragraph()
p1.text = "Discrete Mathematics & Graph Theory (Module 5)"
p1.font.size = Pt(20)
p1.font.bold = True
p1.font.color.rgb = RGBColor(220, 235, 255)
p1.space_after = Pt(8)
p2 = tf.add_paragraph()
p2.text = "Trees & Graph Algorithms in Real-World Systems"
p2.font.size = Pt(36)
p2.font.bold = True
p2.font.color.rgb = COLOR_WHITE
p2.space_after = Pt(12)
p3 = tf.add_paragraph()
p3.text = "Flip Class-9 Presentation • Saturday, November 21st, 2026"
p3.font.size = Pt(15)
p3.font.italic = True
p3.font.color.rgb = RGBColor(254, 215, 120)
p3.space_after = Pt(26)
p4 = tf.add_paragraph()
p4.text = "PRESENTED BY TEAM 6:"
p4.font.size = Pt(12)
p4.font.bold = True
p4.font.color.rgb = RGBColor(180, 205, 240)
p4.space_after = Pt(4)
p5 = tf.add_paragraph()
p5.text = "Sumit | Varad Kanade | Shrivika | Jashnavi | Aryan Singh | Dinakar Sainath | Soumyajyoti"
p5.font.size = Pt(14)
p5.font.bold = True
p5.font.color.rgb = COLOR_WHITE
p5.space_after = Pt(14)
p6 = tf.add_paragraph()
p6.text = "Course Faculty: Dr. Vishal Patil, FET Jain University"
p6.font.size = Pt(12)
p6.font.color.rgb = RGBColor(200, 220, 250)
set_notes(s1, "SPEAKER: Sumit (Team Lead)\nCUE: Welcome everyone, good morning Dr. Vishal Patil sir and fellow classmates! Today, Team 6 is excited to present Flip Class-9 covering Module 5: Trees and Graph Algorithms. We will walk you through core mathematical foundations, the UAV and Industrial Power case studies from our curriculum, and an original disaster-response mesh application problem!")
# ==========================================
# SLIDE 2: Roadmap & Speaker Roster
# ==========================================
s2 = prs.slides.add_slide(blank_layout)
add_header(s2, "Presentation Roadmap & Team Alignment", "Executive Agenda", "Sumit")
roster = [
("1. Trees & Core Properties", "Sumit", "Connected acyclic topology, n-1 edges theorem, tree hierarchies."),
("2. Rooted vs. Spanning Trees", "Varad Kanade", "Root hierarchies, DB indices, traversals vs. telecom/campus spanning."),
("3. Sorting & Flight Sensor Study", "Shrivika", "Divide-and-conquer, 2M+ sensor scaling, UAV Merge Sort walkthrough."),
("4. Prefix Codes & Huffman Coding", "Jashnavi", "Optimal variable-length codes, greedy trees, multimedia compression."),
("5. Weighted Trees & Kruskal's MST", "Aryan Singh", "Industrial Park electrical grid, greedy edge selection, cost savings."),
("6. MST vs. Dijkstra & Differences", "Dinakar Sainath", "Global minimum wire vs. point-to-point shortest path (OSPF/GPS)."),
("7. Original Real-World Problem", "Soumyajyoti", "EcoGrid: Autonomous Disaster Response Drone-Relay Mesh in Western Ghats.")
]
for idx, (title, spkr, desc) in enumerate(roster):
y_pos = Inches(1.75 + idx * 0.72)
r_box = s2.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, Inches(0.8), y_pos, Inches(11.733), Inches(0.62))
r_box.fill.solid()
r_box.fill.fore_color.rgb = RGBColor(245, 248, 252) if idx % 2 == 0 else COLOR_WHITE
r_box.line.color.rgb = COLOR_BORDER
tf_r = r_box.text_frame
tf_r.word_wrap = True
tf_r.margin_left = Inches(0.2)
tf_r.margin_top = Inches(0.1)
p = tf_r.paragraphs[0]
p.text = f"{title}"
p.font.size = Pt(13)
p.font.bold = True
p.font.color.rgb = COLOR_PRIMARY
# Speaker badge text
p_sp = tf_r.add_paragraph()
p_sp.text = f"Presenter: {spkr} | Scope: {desc}"
p_sp.font.size = Pt(11)
p_sp.font.color.rgb = COLOR_TEXT_MUTED
set_notes(s2, "SPEAKER: Sumit\nCUE: Here is our structured breakdown. Every member of Team 6 owns a distinct analytical portion. Notice how we balance theoretical discrete mathematics with real-world engineering implementations.")
# ==========================================
# SLIDE 3: Trees and Basic Properties
# ==========================================
s3 = prs.slides.add_slide(blank_layout)
add_header(s3, "Mathematical Foundations: Trees & Essential Properties", "Foundations", "Sumit")
add_card(s3, Inches(0.8), Inches(1.8), Inches(3.7), Inches(5.0),
"1. Mathematical Definition",
[
"A Tree T = (V, E) is a connected, undirected acyclic graph.",
"No Cycles: Eliminating cycles prevents endless circular loops.",
"Unique Simple Path: Exactly one simple path exists between any pair of vertices u, v ∈ V.",
"Crucial Real-World Analogy: Like a strict company hierarchy—no subordinate can be their own grandparent!"
])
add_card(s3, Inches(4.8), Inches(1.8), Inches(3.7), Inches(5.0),
"2. The n - 1 Edges Theorem",
[
"Theorem: Any tree with n vertices contains exactly (n - 1) edges.",
"Proof Intuition: Start with 1 node (0 edges). Each new connected node requires exactly 1 new edge to maintain acyclicity.",
"Under-constrained (e < n-1): Graph becomes disconnected.",
"Over-constrained (e ≥ n): A cycle is guaranteed to form.",
"Key Metric: Minimizes communication links needed for full reachability."
])
add_card(s3, Inches(8.8), Inches(1.8), Inches(3.7), Inches(5.0),
"3. Applied Engineering Roles",
[
"Operating System Directories: Hierarchical file structures (/root/home/user/...).",
"JSON / XML Data Parsers: Document Object Model (DOM) rendered as a clean tree.",
"Decision & Search Trees: AI game trees, classification boundaries, and state exploration.",
"Corporate Governance: Unidirectional authority flow without contradictory instructions."
])
set_notes(s3, "SPEAKER: Sumit\nCUE: A tree is nature's most economical connected structure. If we have n vertices, exactly n-1 edges provide total connectivity without redundant loops. Let's pass over to Varad to explore how rooting a tree transforms its behavior.")
# ==========================================
# SLIDE 4: Rooted Trees vs. Spanning Trees
# ==========================================
s4 = prs.slides.add_slide(blank_layout)
add_header(s4, "Structural Comparison: Rooted Trees vs. Spanning Trees", "Taxonomy & Structure", "Varad Kanade")
# Table comparing the two
rows, cols = 6, 3
left, top, width, height = Inches(0.8), Inches(1.8), Inches(11.733), Inches(4.9)
table_shape = s4.shapes.add_table(rows, cols, left, top, width, height)
table = table_shape.table
table.columns[0].width = Inches(2.5)
table.columns[1].width = Inches(4.6)
table.columns[2].width = Inches(4.633)
headers = ["Evaluation Metric", "Rooted Trees (Hierarchical)", "Spanning Trees (Infrastructure)"]
for i, h in enumerate(headers):
cell = table.cell(0, i)
cell.fill.solid()
cell.fill.fore_color.rgb = COLOR_PRIMARY
p = cell.text_frame.paragraphs[0]
p.text = h
p.font.bold = True
p.font.size = Pt(13)
p.font.color.rgb = COLOR_WHITE
p.alignment = PP_ALIGN.CENTER
data = [
("Designated Node", "Has an explicit Root node; defines 'top-down' ancestor/descendant relationships.", "No designated root; all vertices are peers in a minimal connected subgraph."),
("Edge Orientation", "Naturally directed (parent → child) away from or toward the root.", "Undirected physical or logical transmission links."),
("Traversals & Order", "Systematic algorithmic traversals: Preorder, Inorder, Postorder, Level-order.", "Focuses on global weight/cost minimization (sum of edge weights Σ w(e))."),
("Critical Property", "Depth, height, subtrees, and branching factor drive performance.", "Spans all |V| vertices using exactly |V| - 1 cycle-free edges."),
("Primary Applications", "Database B/B+ trees, AST compilers, XML/DOM parsing, Decision trees.", "Campus fiber routing, power grids, circuit PCB traces, cluster analysis.")
]
for row_idx, row_data in enumerate(data, start=1):
for col_idx, text in enumerate(row_data):
cell = table.cell(row_idx, col_idx)
cell.fill.solid()
cell.fill.fore_color.rgb = COLOR_WHITE if row_idx % 2 == 1 else RGBColor(241, 245, 249)
p = cell.text_frame.paragraphs[0]
p.text = text
p.font.size = Pt(11)
p.font.color.rgb = COLOR_TEXT_DARK
if col_idx == 0:
p.font.bold = True
p.font.color.rgb = COLOR_SECONDARY
set_notes(s4, "SPEAKER: Varad Kanade\nCUE: Thank you Sumit. The difference comes down to intent: Rooted trees organize authority and search hierarchies top-down, while Spanning trees connect peer entities with minimal physical infrastructure.")
# ==========================================
# SLIDE 5: Efficient Sorting & Divide-and-Conquer
# ==========================================
s5 = prs.slides.add_slide(blank_layout)
add_header(s5, "Sorting Paradigms: Why Divide-and-Conquer Tames Big Data", "Algorithmic Efficiency", "Shrivika")
add_card(s5, Inches(0.8), Inches(1.8), Inches(5.6), Inches(4.9),
"Algorithmic Complexity Comparison",
[
"Bubble / Insertion Sort: O(n²) worst and average case. Comparing every item with every other item fails catastrophically at scale.",
"Merge Sort: O(n log n) guaranteed across Best, Average, and Worst cases via Divide-and-Conquer.",
"Quick Sort: O(n log n) average; highly cache-efficient in-place partitioning (worst case O(n²)).",
"Heap Sort: O(n log n) utilizing a complete binary tree structure (Binary Max/Min Heap).",
"Stability Advantage: Merge Sort preserves original order of identical timestamps—crucial for telemetry!"
])
add_card(s5, Inches(6.8), Inches(1.8), Inches(5.7), Inches(4.9),
"Real-World Impact: The 2 Million Record Test",
[
"Scenario: UAV flight log with n = 2,000,000 sensor readings.",
"Bubble Sort [O(n²)]: (2×10⁶)² = 4 × 10¹² operations. At 10⁸ ops/sec, this takes ~40,000 seconds (≈ 11.1 HOURS!).",
"Merge Sort [O(n log₂ n)]: 2×10⁶ × log₂(2×10⁶) ≈ 2×10⁶ × 21 = 4.2 × 10⁷ operations.",
"Execution Time: Takes ~0.42 SECONDS! Merge Sort is nearly 100,000× faster!",
"Engineering Takeaway: Algorithmic complexity is not academic; it is the boundary between real-time flight safety and mission failure."
])
set_notes(s5, "SPEAKER: Shrivika\nCUE: Why do we sort using recursion and trees? Notice this calculation on the right: on 2 million drone records, an O(n^2) algorithm locks your computer for 11 hours, whereas Merge Sort finishes in under half a second. Let's see this in action on our UAV flight dataset.")
# ==========================================
# SLIDE 6: UAV Flight Sensor Data Merge Sort
# ==========================================
s6 = prs.slides.add_slide(blank_layout)
add_header(s6, "Case Study 1: UAV Flight Sensor Data with Merge Sort", "Curriculum Problem Walkthrough", "Shrivika")
# Step Flow Box
card_uav = s6.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, Inches(0.8), Inches(1.8), Inches(11.733), Inches(4.9))
card_uav.fill.solid()
card_uav.fill.fore_color.rgb = COLOR_BG_CARD
card_uav.line.color.rgb = COLOR_BORDER
tf_uav = card_uav.text_frame
tf_uav.word_wrap = True
tf_uav.margin_left = Inches(0.25)
tf_uav.margin_right = Inches(0.25)
p_u0 = tf_uav.paragraphs[0]
p_u0.text = "Flight Sensor Records: R1(1045), R2(1012), R3(1098), R4(1028), R5(1071), R6(1003)"
p_u0.font.size = Pt(13)
p_u0.font.bold = True
p_u0.font.color.rgb = COLOR_SECONDARY
p_u0.space_after = Pt(8)
steps = [
"1. Split Phase (Divide): Subdivide array into two halves: Left [R1, R2, R3] and Right [R4, R5, R6]. Recursively split to singleton leaves [R1], [R2], [R3] and [R4], [R5], [R6].",
"2. Merge Sub-lists (Conquer & Combine):",
" • Left Tree Merge: Merge [R2(1012)] + [R3(1098)] → [R2, R3]. Then merge [R1(1045)] + [R2, R3] → [R2, R1, R3] (Timestamps: 1012, 1045, 1098).",
" • Right Tree Merge: Merge [R5(1071)] + [R6(1003)] → [R6, R5]. Then merge [R4(1028)] + [R6, R5] → [R6, R4, R5] (Timestamps: 1003, 1028, 1071).",
"3. Final 2-Way Merge: Compare heads of [R2, R1, R3] and [R6, R4, R5]:",
" • Compare 1012 vs 1003 → Pick R6(1003) | Compare 1012 vs 1028 → Pick R2(1012) | Compare 1045 vs 1028 → Pick R4(1028)",
" • Compare 1045 vs 1071 → Pick R1(1045) | Compare 1098 vs 1071 → Pick R5(1071) | Remainder → Pick R3(1098)",
"4. Final Chronological Order: R6 (1003 ms) → R2 (1012 ms) → R4 (1028 ms) → R1 (1045 ms) → R5 (1071 ms) → R3 (1098 ms)",
"5. Scalability Insights: Subsystem logs combine via k-Way Merge with Min-Heap in O(n log k); streaming live data uses Sliding Windows/Min-Heaps."
]
for s in steps:
p = tf_uav.add_paragraph()
p.text = s
p.font.size = Pt(11.5)
p.font.color.rgb = COLOR_TEXT_DARK
p.space_after = Pt(4)
set_notes(s6, "SPEAKER: Shrivika\nCUE: Here is the exact step-by-step breakdown from our flip class material. Because sensor packets arrive out of order over radio links, unorganized data would corrupt flight trajectory reconstruction. With Merge Sort, we achieve a clean chronological stream.")
# ==========================================
# SLIDE 7: Prefix Codes & Huffman Coding
# ==========================================
s7 = prs.slides.add_slide(blank_layout)
add_header(s7, "Prefix Codes & Optimal Data Compression (Huffman Coding)", "Information Theory & Greedy Trees", "Jashnavi")
add_card(s7, Inches(0.8), Inches(1.8), Inches(5.6), Inches(4.9),
"The Prefix Code Principle",
[
"Definition: A code system where no valid code word is a prefix of any other valid code word.",
"Instant Decodability: The receiver decodes data on-the-fly without needing separator delimiters (e.g., spaces or commas).",
"Binary Tree Representation: Symbols sit strictly at leaf nodes; left branch = '0', right branch = '1'.",
"Huffman's Greedy Optimization: Highly frequent characters receive shorter bit sequences; rare symbols receive longer paths.",
"Average Code Length: L_avg = Σ (f_i × len(c_i)) is mathematically minimized."
])
add_card(s7, Inches(6.8), Inches(1.8), Inches(5.7), Inches(4.9),
"Step-by-Step Huffman Tree Construction",
[
"1. Compute Frequencies: Count symbol occurrences across the message/stream.",
"2. Min-Priority Queue: Enqueue each symbol as a single-node tree keyed by frequency.",
"3. Greedy Merge Loop: Extract the two trees with lowest frequencies f1 and f2; create a new parent node with weight f1 + f2; re-insert into queue.",
"4. Repeat until 1 tree remains: The final tree root encompasses the entire alphabet.",
"Real-World Impact: The foundational engine behind GZIP, PKZIP, JPEG image encoding, MP3 audio, and HTTP/2 header compression (HPACK)."
])
set_notes(s7, "SPEAKER: Jashnavi\nCUE: Thank you Shrivika. Just like in Morse code where the most common letter 'E' is a simple single dot, Huffman Coding greedily builds a binary tree that assigns the shortest binary sequences to the most frequent characters. It powers the compression formats we use daily.")
# ==========================================
# SLIDE 8: Weighted Trees & Minimum Spanning Trees
# ==========================================
s8 = prs.slides.add_slide(blank_layout)
add_header(s8, "Weighted Graphs & Minimum Spanning Trees (MST)", "Network Optimization", "Aryan Singh")
add_card(s8, Inches(0.8), Inches(1.8), Inches(3.7), Inches(4.9),
"1. Weighted Graphs",
[
"Graph G = (V, E, w) where each edge has a numerical weight.",
"Weights represent real engineering constraints: Cable length (meters), digging cost ($), latency (ms), or energy loss.",
"Objective: Interconnect all entities at absolute minimum cumulative weight: min Σ w(e)."
])
add_card(s8, Inches(4.8), Inches(1.8), Inches(3.7), Inches(4.9),
"2. Kruskal's Algorithm",
[
"Edge-Centric Greedy approach.",
"Step 1: Sort all edges globally in non-decreasing order of weight.",
"Step 2: Greedily pick the smallest edge.",
"Step 3: Add to MST if and only if it does NOT create a cycle (using Disjoint Set / Union-Find).",
"Best for: Sparse graphs (few edges)."
])
add_card(s8, Inches(8.8), Inches(1.8), Inches(3.7), Inches(4.9),
"3. Prim's Algorithm",
[
"Vertex-Centric Greedy approach.",
"Step 1: Start at an arbitrary root vertex.",
"Step 2: Maintain a growing cut/tree.",
"Step 3: Greedily add the cheapest edge connecting a tree vertex to an unvisited vertex.",
"Best for: Dense graphs with Priority Queues / Fibonacci Heaps."
])
set_notes(s8, "SPEAKER: Aryan Singh\nCUE: When edges carry physical costs, we need Minimum Spanning Trees. Kruskal's algorithm takes an edge-first greedy view, sorting all links and uniting disjoint components without cycles. Let's inspect our industrial electrical distribution case study.")
# ==========================================
# SLIDE 9: Industrial Park Electrical Network
# ==========================================
s9 = prs.slides.add_slide(blank_layout)
add_header(s9, "Case Study 2: Industrial Park Electrical Grid via Kruskal's", "Curriculum Problem Walkthrough", "Aryan Singh")
add_card(s9, Inches(0.8), Inches(1.8), Inches(5.6), Inches(4.9),
"Problem Setup & Edge Sorting",
[
"Facilities (Vertices): A (Substation), B (Unit 1), C (Unit 2), D (Warehouse), E (Admin), F (Solar Station). Total: 6 vertices (needs 5 edges).",
"All Feasible Edges (9 total, 1160m total length):",
"B-C: 80m | C-D: 90m | D-E: 100m | E-F: 110m | A-B: 120m",
"D-F: 140m | A-C: 150m | B-D: 170m | C-E: 200m",
"Greedy Execution Trace:",
"• Pick B-C (80m) → Accepted (No cycle)",
"• Pick C-D (90m) → Accepted (No cycle)",
"• Pick D-E (100m) → Accepted (No cycle)",
"• Pick E-F (110m) → Accepted (No cycle)",
"• Pick A-B (120m) → Accepted (Connects Substation A!)",
"• Stop: 5 edges selected for 6 vertices (|V| - 1)."
])
add_card(s9, Inches(6.8), Inches(1.8), Inches(5.7), Inches(4.9),
"Engineering Economics & Tradeoffs",
[
"Total MST Cable Length: 80 + 90 + 100 + 110 + 120 = 500 meters.",
"Cable Saved vs. Mesh: 1160m - 500m = 660 meters saved (56.9% reduction!).",
"Benefits: Huge savings in copper cabling, excavation, labor, and lower electrical line resistance (I²R losses).",
"Critical Engineering Questions:",
"Q: What if rocky terrain triples C-D excavation cost? (90m → 270 cost)",
"A: Kruskal naturally diverts via D-F (140) to bypass expensive rocky trenches!",
"Q: Why is an MST alone risky in real grids?",
"A: Zero redundancy! A single cable rupture blackouts downstream facilities. Real grids add strategic n-1 backup tie-lines."
])
set_notes(s9, "SPEAKER: Aryan Singh\nCUE: Kruskal's algorithm cuts our cable deployment by over 56%, saving 660 meters of high-voltage wire. But notice our critical engineering insight: an MST has zero redundancy. In practice, engineers keep one redundant ring backup. Now Dinakar will clarify MST vs Dijkstra.")
# ==========================================
# SLIDE 10: MST vs. Dijkstra's Shortest Path
# ==========================================
s10 = prs.slides.add_slide(blank_layout)
add_header(s10, "MST vs. Dijkstra: The Essential Algorithmic Divide", "Comparative Analysis", "Dinakar Sainath")
# Table comparing MST and Dijkstra
rows, cols = 6, 3
table_shape10 = s10.shapes.add_table(rows, cols, Inches(0.8), Inches(1.8), Inches(11.733), Inches(4.9))
t10 = table_shape10.table
t10.columns[0].width = Inches(2.3)
t10.columns[1].width = Inches(4.7)
t10.columns[2].width = Inches(4.733)
h10 = ["Dimension", "Minimum Spanning Tree (MST)", "Dijkstra's Shortest Path Algorithm"]
for i, h in enumerate(h10):
cell = t10.cell(0, i)
cell.fill.solid()
cell.fill.fore_color.rgb = COLOR_PRIMARY
p = cell.text_frame.paragraphs[0]
p.text = h
p.font.bold = True
p.font.size = Pt(13)
p.font.color.rgb = COLOR_WHITE
p.alignment = PP_ALIGN.CENTER
d10 = [
("Fundamental Objective", "Minimizes the GLOBAL sum of all edge weights to connect every vertex: min Σ w(e).", "Minimizes the INDIVIDUAL path cost from one designated source vertex s to all other vertices."),
("Input Requirements", "Connected, undirected weighted graph.", "Directed or undirected graph with NON-NEGATIVE edge weights."),
("Tree Structure", "Yields an unrooted spanning tree spanning all vertices at minimal collective cost.", "Yields a Shortest-Path Tree (SPT) rooted strictly at source vertex s."),
("Path Optimality", "Does NOT guarantee shortest paths between individual pairs of nodes.", "Guarantees mathematically shortest routes from source, but total tree weight is higher."),
("Real-World Analogy", "Laying fiber-optic cable across campus at cheapest construction budget.", "Google Maps / GPS navigation routing an ambulance from Hospital to accident site.")
]
for row_idx, row_data in enumerate(d10, start=1):
for col_idx, text in enumerate(row_data):
cell = t10.cell(row_idx, col_idx)
cell.fill.solid()
cell.fill.fore_color.rgb = COLOR_WHITE if row_idx % 2 == 1 else RGBColor(241, 245, 249)
p = cell.text_frame.paragraphs[0]
p.text = text
p.font.size = Pt(11)
p.font.color.rgb = COLOR_TEXT_DARK
if col_idx == 0:
p.font.bold = True
p.font.color.rgb = COLOR_SECONDARY
set_notes(s10, "SPEAKER: Dinakar Sainath\nCUE: This is the most common exam and interview confusion. MST asks: 'How do we connect all cities with the least total asphalt?' Dijkstra asks: 'How does an ambulance get from City A to City B as fast as possible?' Now, let's explore our original real-world project problem.")
# ==========================================
# SLIDE 11: Original Problem - Scenario & Setup
# ==========================================
s11 = prs.slides.add_slide(blank_layout)
add_header(s11, "Original Problem: EcoGrid Autonomous Disaster Relay Mesh", "Creative Real-World Application", "Dinakar Sainath")
add_card(s11, Inches(0.8), Inches(1.8), Inches(5.6), Inches(4.9),
"Operational Context & Challenge",
[
"Geographic Scenario: Heavy monsoon flooding and landslides in the Western Ghats (Coorg/Wayanad region) sever all physical roads and cellular towers.",
"Disaster Nodes (6 critical sites):",
" • S₀: Central Incident Command & Satellite Ground Hub",
" • R₁: Riverbank Relief Camp 1",
" • R₂: Hilltop Emergency Medical Tent",
" • R₃: Isolated Village Evacuation Center",
" • R₄: Field Supply Airstrip",
" • H₅: Regional Trauma Hospital Heliport",
"Objective: Deploy tethered autonomous drone relays to establish an emergency high-frequency telemetry & voice mesh network."
])
add_card(s11, Inches(6.8), Inches(1.8), Inches(5.7), Inches(4.9),
"Engineering Constraints & Mathematical Weights",
[
"Line-of-Sight & RF Path Loss: Drone-to-drone wireless attenuation depends on mountain terrain obstacles and distance.",
"Edge Weight Metric: w(u, v) = RF Path Loss / Latency Score (lower is superior communication quality).",
"Feasible Wireless Relay Channels (8 potential links):",
" • S₀-R₁: 14 dB | S₀-R₂: 22 dB | R₁-R₂: 9 dB",
" • R₁-R₃: 18 dB | R₂-R₄: 12 dB | R₃-R₄: 7 dB",
" • R₃-H₅: 16 dB | R₄-H₅: 11 dB",
"Two-Pronged Algorithmic Pipeline:",
" 1. Kruskal's MST to construct the minimum RF attenuation backbone.",
" 2. Huffman Coding on emergency distress packets over the link."
])
set_notes(s11, "SPEAKER: Dinakar Sainath\nCUE: For our original problem, Team 6 designed EcoGrid: an emergency autonomous drone communication network deployed during landslides. Cellular towers are wiped out, so drones hover as aerial relays. Let's trace how Discrete Math solves this emergency.")
# ==========================================
# SLIDE 12: Original Problem - Step-by-Step Solution
# ==========================================
s12 = prs.slides.add_slide(blank_layout)
add_header(s12, "EcoGrid Solution: Kruskal's Backbone & Huffman Telemetry", "Algorithmic Walkthrough", "Soumyajyoti")
add_card(s12, Inches(0.8), Inches(1.8), Inches(5.6), Inches(4.9),
"Phase 1: Kruskal's Emergency Relay MST",
[
"1. Sorted Feasible Edges (RF Attenuation Score):",
" R3-R4 (7) | R1-R2 (9) | R4-H5 (11) | R2-R4 (12)",
" S0-R1 (14) | R3-H5 (16) | R1-R3 (18) | S0-R2 (22)",
"2. Greedy Step Execution:",
" • Select R3-R4 (7) → Accepted (Component {R3, R4})",
" • Select R1-R2 (9) → Accepted (Component {R1, R2})",
" • Select R4-H5 (11) → Accepted (Component {R3, R4, H5})",
" • Select R2-R4 (12) → Accepted (Merges {R1, R2, R3, R4, H5})",
" • Select S0-R1 (14) → Accepted (Connects Command Hub S0!)",
" • Reject R3-H5, R1-R3, S0-R2 (would form cycles).",
"Total MST Network Attenuation: 7 + 9 + 11 + 12 + 14 = 53 dB.",
"Efficiency: Reduced from 109 dB mesh total to 53 dB (51.4% signal loss reduction)."
])
add_card(s12, Inches(6.8), Inches(1.8), Inches(5.7), Inches(4.9),
"Phase 2: Huffman Distress Packet Compression",
[
"Distress Telemetry Stream: High-frequency telemetry broadcasts 4 critical emergency signals:",
" • 'O' (Oxygen Level): freq = 50%",
" • 'P' (Pulse / Heartbeat): freq = 25%",
" • 'T' (Temperature): freq = 15%",
" • 'E' (Emergency SOS): freq = 10%",
"Huffman Coding Result:",
" • 'O' (50%) → Code '0' (1 bit)",
" • 'P' (25%) → Code '10' (2 bits)",
" • 'T' (15%) → Code '110' (3 bits)",
" • 'E' (10%) → Code '111' (3 bits)",
"Average Bit Length: 0.5(1) + 0.25(2) + 0.15(3) + 0.10(3) = 1.75 bits/symbol vs. standard ASCII (8 bits) or 2-bit fixed.",
"Result: 78.1% bandwidth savings over constrained drone radios!"
])
set_notes(s12, "SPEAKER: Soumyajyoti\nCUE: Thank you Dinakar. By applying Kruskal's algorithm, we establish a robust backbone connecting all 6 disaster camps with the lowest RF signal attenuation (53 dB). Then, on top of this physical topology, we compress vital patient sensor packets using Huffman coding to just 1.75 bits per transmission!")
# ==========================================
# SLIDE 13: Critical Thinking & Faculty Sparks
# ==========================================
s13 = prs.slides.add_slide(blank_layout)
add_header(s13, "Critical Thinking & Flip Class Discussion Sparks", "Interactive Inquiries", "Soumyajyoti")
prompts = [
("Q1: Dynamic Edge Variations", "What happens when high winds or drone battery depletion changes an edge weight in real time? (Dynamic MST / Incremental Graph algorithms update links without re-computing from scratch)."),
("Q2: Redundancy vs. Pure Minimization", "Why can an MST never be deployed as-is in mission-critical aerospace or medical systems? (Bridge edges: cutting one link splits the graph. Real systems add biconnected components)."),
("Q3: Batch vs. Real-Time Streaming", "Why can't Merge Sort handle live continuous sensor telemetry in flight? (Requires all records upfront; streaming models require Priority Queues / Sliding Windows)."),
("Q4: Terrain & Obstacle Multipliers", "How do cost multipliers affect Kruskal's choices? (Tripling excavation or signal obstruction costs drives the greedy algorithm to alternate topological bypasses).")
]
for idx, (title, ans) in enumerate(prompts):
y_pos = Inches(1.75 + idx * 1.25)
p_box = s13.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, Inches(0.8), y_pos, Inches(11.733), Inches(1.15))
p_box.fill.solid()
p_box.fill.fore_color.rgb = COLOR_BG_CARD
p_box.line.color.rgb = COLOR_SECONDARY
p_box.line.width = Pt(1.5)
tf_p = p_box.text_frame
tf_p.word_wrap = True
tf_p.margin_left = Inches(0.25)
tf_p.margin_top = Inches(0.12)
p = tf_p.paragraphs[0]
p.text = title
p.font.size = Pt(13)
p.font.bold = True
p.font.color.rgb = COLOR_PRIMARY
p_a = tf_p.add_paragraph()
p_a.text = ans
p_a.font.size = Pt(11)
p_a.font.color.rgb = COLOR_TEXT_DARK
set_notes(s13, "SPEAKER: Soumyajyoti\nCUE: These four critical thinking questions bridge our discrete mathematics curriculum with real engineering problem solving. Let's conclude our presentation.")
# ==========================================
# SLIDE 14: Conclusion & Q&A
# ==========================================
s14 = prs.slides.add_slide(blank_layout)
bg14 = s14.shapes.add_shape(MSO_SHAPE.RECTANGLE, 0, 0, Inches(13.333), Inches(7.5))
bg14.fill.solid()
bg14.fill.fore_color.rgb = COLOR_PRIMARY
bg14.line.fill.background()
tb14 = s14.shapes.add_textbox(Inches(1.2), Inches(1.2), Inches(10.933), Inches(5.1))
tf14 = tb14.text_frame
tf14.word_wrap = True
p_c0 = tf14.paragraphs[0]
p_c0.text = "SUMMARY OF KEY TAKEAWAYS"
p_c0.font.size = Pt(14)
p_c0.font.bold = True
p_c0.font.color.rgb = COLOR_ACCENT
p_c0.space_after = Pt(10)
p_c1 = tf14.add_paragraph()
p_c1.text = "Mathematical Structures → Real Engineering Solutions"
p_c1.font.size = Pt(30)
p_c1.font.bold = True
p_c1.font.color.rgb = COLOR_WHITE
p_c1.space_after = Pt(18)
summary_bullets = [
"Trees guarantee optimal loop-free connectivity: exactly n - 1 edges bind n nodes.",
"Divide-and-Conquer (Merge Sort) scales O(n log n) across millions of asynchronous sensor logs.",
"Greedy Optimization in Huffman Coding minimizes data size; in Kruskal's/Prim's it minimizes network deployment cost.",
"Distinction Matters: MST minimizes collective infrastructure wire; Dijkstra minimizes point-to-point transit latency.",
"Applied Synergy: Combining Graph MSTs and Tree Prefix Codes enables robust disaster-relief cyber-physical systems."
]
for b in summary_bullets:
p = tf14.add_paragraph()
p.text = f"✔ {b}"
p.font.size = Pt(13)
p.font.color.rgb = RGBColor(220, 235, 255)
p.space_after = Pt(6)
p_qa = tf14.add_paragraph()
p_qa.text = "\nThank you Dr. Vishal Patil sir & classmates! We are now open for Questions & Discussion."
p_qa.font.size = Pt(15)
p_qa.font.bold = True
p_qa.font.color.rgb = RGBColor(254, 215, 120)
set_notes(s14, "ALL PRESENTERS / Sumit\nCUE: On behalf of Sumit, Varad, Shrivika, Jashnavi, Aryan, Dinakar, and Soumyajyoti, thank you Dr. Vishal Patil sir and fellow classmates. We are eager to take any questions on our algorithms or real-world modeling!")
# Save presentation
output_path = r"c:\Users\prath\OneDrive\Documents\OS mini project\Module5_Trees_and_Graph_Algorithms_Team6.pptx"
prs.save(output_path)
print(f"Presentation saved successfully to: {output_path}")
if __name__ == "__main__":
create_deck()