├── README.md ├── Research Paper (UROP).pdf ├── computation_offloading ├── offloading_simulation.py └── offloading_visualization.py ├── main.py ├── path_planning ├── dijkstra_algorithm.py └── graph_visualization.py └── wireless_power_transfer ├── wpt_simulation.py └── wpt_visualization.py /README.md: -------------------------------------------------------------------------------- 1 | # UAV-IoT Network Research Project 2 | 3 | ### Dynamic Path Planning, Computation Offloading, and Wireless Power Transfer (WPT) for UAV-IoT Networks 4 | 5 | This research project explores advanced algorithms for efficient and sustainable UAV (Unmanned Aerial Vehicle) operations within IoT networks. It implements **Dynamic Path Planning**, **Computation Offloading**, and **Energy-Efficient Wireless Power Transfer (WPT)** using Python. Each component simulates and visualizes critical functions in UAV IoT systems, paving the way for energy-saving, reliable, and high-performance UAV networks. 6 | 7 | # 🚀 Features 8 | 9 | - **Dynamic UAV Path Planning:** Shortest path optimization using Dijkstra's Algorithm. 10 | - **Computation Offloading:** Adaptive task offloading based on energy thresholds. 11 | - **Wireless Power Transfer (WPT):** Efficient energy transfer simulation using resonant inductive coupling. 12 | - **Interactive Visualizations:** Real-time visualizations for path planning, offloading points, and WPT efficiency. 13 | 14 | # 📁 Project Structure 15 | 16 | ```plaintext 17 | UAV-IoT-Research-Project/ 18 | │ 19 | ├── PROJECT_OVERVIEW.md # Project overview 20 | ├── FEATURES.md # Project features 21 | ├── INSTALLATION.md # Installation instructions 22 | ├── USAGE.md # Usage guide 23 | ├── EXAMPLES.md # Example visualizations 24 | ├── ACKNOWLEDGMENTS.md # Acknowledgments 25 | ├── LICENSE.md # License information 26 | ├── requirements.txt # Python libraries required 27 | ├── main.py # Main script to run all simulations 28 | │ 29 | ├── path_planning/ 30 | │ ├── dijkstra_algorithm.py # Dijkstra's algorithm implementation for path planning 31 | │ └── graph_visualization.py # Visualization of graph with shortest path 32 | │ 33 | ├── computation_offloading/ 34 | │ ├── offloading_simulation.py # Computation offloading simulation 35 | │ └── offloading_visualization.py # Visualization of energy levels and offloading points 36 | │ 37 | └── wireless_power_transfer/ 38 | ├── wpt_simulation.py # Wireless power transfer simulation 39 | └── wpt_visualization.py # Visualization of power transfer efficiency 40 | 41 | ``` 42 | --- 43 | 44 | # ⚙️ Usage 45 | Run the main script to execute all simulations sequentially. 46 | 47 | **Individual Module Details** 48 | 49 | **1. Dynamic Path Planning:** 50 | - Implements Dijkstra's Algorithm to find the shortest path between nodes. 51 | - Output: Path and total distance. 52 | - Visualization: Graph highlighting the shortest path. 53 | 54 | **2. Computation Offloading:** 55 | - Simulates offloading of tasks based on energy thresholds. 56 | - Output: Energy levels and offloading points. 57 | - Visualization: Graph showing energy depletion and offloading events. 58 | 59 | **3. Wireless Power Transfer (WPT):** 60 | - Models power transfer efficiency over distance. 61 | - Output: Transferred power levels. 62 | - Visualization: Graph showing power efficiency across distances. 63 | 64 | # 📦 Installation 65 | 66 | Follow these steps to set up the project on your local machine. 67 | 68 | **Step 1: Clone the repository** 69 | 70 | git clone https://github.com/Sahil0502/Dynamic-path-planning-and-computation-offloading-in-Wireless-Powered-UAV-IoT-Network.git 71 | cd UAV-IoT-Research-Project 72 | 73 | **Step 2: Set Up a Virtual Environment (Optional but Recommended)** 74 | To prevent dependency conflicts, it’s best to create a virtual environment. 75 | - **Create a virtual environment:** 76 | 77 | python3 -m venv venv 78 | 79 | - **Activate the virtual environment:** 80 | On Windows: 81 | 82 | .\venv\Scripts\activate 83 | 84 | On macOS/Linux: 85 | 86 | source venv/bin/activate 87 | 88 | **Step 3: Install Required Libraries** 89 | 90 | Install the dependencies listed in requirements.txt. 91 | 92 | pip install -r requirements.txt 93 | 94 | Dependencies include: 95 | - NetworkX for graph computations in path planning. 96 | - Matplotlib for visualization. 97 | - NumPy for numerical operations. 98 | 99 | **Step 4: Verify the Installation** 100 | Run the main script to verify that everything is set up correctly. 101 | 102 | python main.py 103 | This command will initialize each module, generate example visualizations, and display any errors if dependencies or configurations are incorrect. 104 | 105 | 106 | 107 | # 🤝 Acknowledgments 108 | 109 | - **NetworkX** for graph structure and pathfinding support. 110 | - **Matplotlib** for data visualization and real-time plotting. 111 | - **NumPy** for numerical operations. 112 | 113 | # 📜 License 114 | 115 | This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information. 116 | -------------------------------------------------------------------------------- /Research Paper (UROP).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sahil0502/Dynamic-path-planning-and-computation-offloading-in-Wireless-Powered-UAV-IoT-Network/f1db0a5c9c0b4195eb7d00eb6452f32ff4a1163e/Research Paper (UROP).pdf -------------------------------------------------------------------------------- /computation_offloading/offloading_simulation.py: -------------------------------------------------------------------------------- 1 | # computation_offloading/offloading_simulation.py 2 | 3 | import numpy as np 4 | 5 | def run_offloading_simulation(initial_energy, energy_threshold): 6 | energy_levels = [initial_energy] 7 | offloading_points = [] 8 | 9 | for i in range(1, 11): 10 | energy = energy_levels[-1] - np.random.randint(5, 15) 11 | energy_levels.append(energy) 12 | 13 | if energy < energy_threshold: 14 | offloading_points.append(i) 15 | energy_levels[-1] = initial_energy # Recharging after offloading 16 | 17 | return energy_levels, offloading_points 18 | -------------------------------------------------------------------------------- /computation_offloading/offloading_visualization.py: -------------------------------------------------------------------------------- 1 | # computation_offloading/offloading_visualization.py 2 | 3 | import matplotlib.pyplot as plt 4 | 5 | def plot_offloading_simulation(energy_levels, offloading_points): 6 | plt.figure(figsize=(10, 5)) 7 | plt.plot(energy_levels, label='Energy Level', color='blue') 8 | plt.scatter(offloading_points, [energy_levels[i] for i in offloading_points], color='red', label='Offloading Points') 9 | plt.xlabel('Task Number') 10 | plt.ylabel('Energy Level') 11 | plt.title('Computation Offloading Simulation') 12 | plt.legend() 13 | plt.show() 14 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # main.py 2 | from path_planning.dijkstra_algorithm import run_dijkstra 3 | from path_planning.graph_visualization import plot_graph 4 | from computation_offloading.offloading_simulation import run_offloading_simulation 5 | from computation_offloading.offloading_visualization import plot_offloading_simulation 6 | from wireless_power_transfer.wpt_simulation import run_wpt_simulation 7 | from wireless_power_transfer.wpt_visualization import plot_wpt_simulation 8 | 9 | def main(): 10 | print("Starting UAV IoT Network Research Project Simulations...") 11 | 12 | # Dynamic Path Planning 13 | print("\nRunning Dynamic Path Planning (Dijkstra's Algorithm)...") 14 | graph = { 15 | 'A': {'B': 2, 'C': 5}, 16 | 'B': {'A': 2, 'C': 3, 'D': 4}, 17 | 'C': {'A': 5, 'B': 3, 'D': 2, 'E': 3}, 18 | 'D': {'B': 4, 'C': 2, 'E': 1}, 19 | 'E': {'C': 3, 'D': 1} 20 | } 21 | start_node = 'A' 22 | end_node = 'E' 23 | distances, shortest_path = run_dijkstra(graph, start_node, end_node) 24 | print(f"Shortest path from {start_node} to {end_node}: {shortest_path} with distance {distances[end_node]}") 25 | plot_graph(graph, shortest_path) 26 | 27 | # Computation Offloading 28 | print("\nRunning Computation Offloading Simulation...") 29 | initial_energy = 100 30 | energy_threshold = 30 31 | energy_levels, offloading_points = run_offloading_simulation(initial_energy, energy_threshold) 32 | print(f"Energy levels: {energy_levels}") 33 | print(f"Tasks offloaded at points: {offloading_points}") 34 | plot_offloading_simulation(energy_levels, offloading_points) 35 | 36 | # Wireless Power Transfer 37 | print("\nRunning Wireless Power Transfer (WPT) Simulation...") 38 | max_power = 50 # Max power in watts 39 | efficiency_constant = 100 # Efficiency constant for WPT 40 | distances, transferred_powers = run_wpt_simulation(max_power, efficiency_constant) 41 | print(f"Transferred power over distances: {transferred_powers}") 42 | plot_wpt_simulation(distances, transferred_powers) 43 | 44 | if __name__ == "__main__": 45 | main() 46 | -------------------------------------------------------------------------------- /path_planning/dijkstra_algorithm.py: -------------------------------------------------------------------------------- 1 | # path_planning/dijkstra_algorithm.py 2 | 3 | import heapq 4 | 5 | def run_dijkstra(graph, start, end): 6 | distances = {node: float('infinity') for node in graph} 7 | distances[start] = 0 8 | priority_queue = [(0, start)] 9 | path = {node: None for node in graph} 10 | 11 | while priority_queue: 12 | current_distance, current_node = heapq.heappop(priority_queue) 13 | 14 | if current_node == end: 15 | break 16 | 17 | if current_distance > distances[current_node]: 18 | continue 19 | 20 | for neighbor, weight in graph[current_node].items(): 21 | distance = current_distance + weight 22 | 23 | if distance < distances[neighbor]: 24 | distances[neighbor] = distance 25 | path[neighbor] = current_node 26 | heapq.heappush(priority_queue, (distance, neighbor)) 27 | 28 | shortest_path = [] 29 | current = end 30 | while current: 31 | shortest_path.append(current) 32 | current = path[current] 33 | shortest_path.reverse() 34 | 35 | return distances, shortest_path 36 | -------------------------------------------------------------------------------- /path_planning/graph_visualization.py: -------------------------------------------------------------------------------- 1 | # path_planning/graph_visualization.py 2 | 3 | import matplotlib.pyplot as plt 4 | import networkx as nx 5 | 6 | def plot_graph(graph, shortest_path): 7 | G = nx.Graph() 8 | for node, edges in graph.items(): 9 | for neighbor, weight in edges.items(): 10 | G.add_edge(node, neighbor, weight=weight) 11 | 12 | pos = nx.spring_layout(G) 13 | nx.draw(G, pos, with_labels=True, node_size=700, node_color="skyblue", font_size=12, font_weight="bold") 14 | nx.draw_networkx_edge_labels(G, pos, edge_labels={(u, v): d["weight"] for u, v, d in G.edges(data=True)}) 15 | 16 | # Highlight the shortest path in red 17 | path_edges = list(zip(shortest_path, shortest_path[1:])) 18 | nx.draw_networkx_edges(G, pos, edgelist=path_edges, edge_color="red", width=2.5) 19 | plt.title("UAV Path Planning using Dijkstra's Algorithm") 20 | plt.show() 21 | -------------------------------------------------------------------------------- /wireless_power_transfer/wpt_simulation.py: -------------------------------------------------------------------------------- 1 | # wireless_power_transfer/wpt_simulation.py 2 | 3 | import numpy as np 4 | 5 | def run_wpt_simulation(max_power, efficiency_constant): 6 | distances = np.arange(1, 11) 7 | transferred_powers = max_power * (efficiency_constant / (distances**2)) 8 | return distances, transferred_powers 9 | -------------------------------------------------------------------------------- /wireless_power_transfer/wpt_visualization.py: -------------------------------------------------------------------------------- 1 | # wireless_power_transfer/wpt_visualization.py 2 | 3 | import matplotlib.pyplot as plt 4 | 5 | def plot_wpt_simulation(distances, transferred_powers): 6 | plt.figure(figsize=(10, 5)) 7 | plt.plot(distances, transferred_powers, marker='o', color='green') 8 | plt.xlabel('Distance') 9 | plt.ylabel('Transferred Power') 10 | plt.title('Wireless Power Transfer Efficiency') 11 | plt.show() 12 | --------------------------------------------------------------------------------