0% found this document useful (0 votes)
5 views

Numerical_Data_Processing_by_The_Implementation_of

The document discusses the implementation of decision trees and Dijkstra's algorithm for numerical data processing in transportation and logistics. It highlights how decision trees can enhance decision-making by modeling outcomes based on various factors, while Dijkstra's algorithm efficiently finds the shortest paths in graphs, applicable to scenarios like metro systems. The paper includes practical examples and C language implementations to demonstrate these concepts.

Uploaded by

hirpaadugna1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Numerical_Data_Processing_by_The_Implementation_of

The document discusses the implementation of decision trees and Dijkstra's algorithm for numerical data processing in transportation and logistics. It highlights how decision trees can enhance decision-making by modeling outcomes based on various factors, while Dijkstra's algorithm efficiently finds the shortest paths in graphs, applicable to scenarios like metro systems. The paper includes practical examples and C language implementations to demonstrate these concepts.

Uploaded by

hirpaadugna1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

International Research Journal on Advanced Engineering e ISSN: 2584-2854

Volume: 02
and Management Issue: 11 November 2024
https://goldncloudpublications.com Page No: 3256-3260
https://doi.org/10.47392/IRJAEM.2024.0479

Numerical Data Processing by The Implementation of Trees and Graphs


Dhanashri Korpad1, Nisha Satpute2, Nayana Joshi3, Snehal Kulkarni4, Komal Walgude5, Neha Dhadiwal6
1,2,3,4,6
Assistant Professor, Vishwakarma College of Arts, Commerce and Science, Pune, Maharashtra, India.
5
HMIS Executive, Symbiosis Medical College for Women, Pune, Maharashtra, India.
Email ID: [email protected], [email protected], [email protected],
[email protected], [email protected], [email protected]

Abstract
Trees and Graphs play a vital role in transport and logistics. In tree, decision tree is one of the important, not
only implemented for data processing, but also considered for Numerical data analysis. The decision tree is a
flow chart-like structure, in which each internal node represents a ‘test’ on an attribute, which has a node
known as root being at the top, which further divides the given data into branches depending upon the
conditions. Every branch consists of a rule, and each leaf node is its outcome. A support tool with a tree-like
structure that models probable outcomes, cost of resources, utilities, and possible consequences. Decision
trees are also used in operations research along with planning logistics. They can help in determining
appropriate plans that will help a company achieve its target. In Graph, Dijkstra's algorithm is an admired
algorithm used to find the shortest paths between nodes in a graph, which may represent road networks for
example. Dijkstra's algorithm finds the shortest path from a given source node to every other node. It can also
be used to find the shortest path to a specific destination node, by concluding the algorithm once the shortest
path to the destination node is found. It is also commonly used on graphs where the edge weights are in real
numbers. A common application of shortest path algorithms is network routing protocols and also support in
route optimization for delivery services, ensuring timely and cost-effective deliveries by finding the best paths
for transportation.
Keywords: Data Processing; Dijkstra's Algorithm; Graph; Shortest Path; Tree

1. Introduction
This paper aims to explore the theoretical foundations in nature than qualitative. Both Decision tree and
and practical applications of shortest path algorithms, Dijkstra's algorithm, are one of the perfect algorithms
particularly Dijkstra's algorithm, while examining for quantitative analysis.
how decision trees can enhance decision-making in 2. Decision Tree
this context. Through a comprehensive analysis of Decision tree is the process that helps to collect data
these topics, one can highlight their significance in which gather relevant data related to the incident
contemporary computational problems and identify based on the type which extract the relevant features
potential areas for future research and application. from the data for that time of day and location. With
The ability to quickly determine the shortest path not the help of the decision tree, one can model the data
only saves resources but also enhances overall using the labelled incident and then evaluate and
efficiency in transportation and communication. As deploy with a real time environment, to detect the
global networks continue to expand, the need for incident with the help of predictive maintenance and
effective pathfinding solutions becomes increasingly safety monitoring which will identify the potential
vital. Numerical Data Processing is more quantitative safety risks or hazards.

IRJAEM 3256
International Research Journal on Advanced Engineering e ISSN: 2584-2854
Volume: 02
and Management Issue: 11 November 2024
https://goldncloudpublications.com Page No: 3256-3260
https://doi.org/10.47392/IRJAEM.2024.0479

2.1. Diagram of Decision Tree of PMPML (Pune 2.2. C Language Implementation of a Simple
Mahanagar Parivahan Mahamandal Ltd): Decision Tree
2.1.1.Data Analysis on the Basis of Time Here’s an illustrative implementation of a decision
Form Saswad to Swargate [1] tree that decides the best bus route based on
Route 1: Saswad - Dive Ghat- Hadapsar- Fatima hypothetical data [2].
Nagar- Swargate.
Route 2: Saswad- Bop Dev Ghat- Khadi Machine #include <stdio.h>
Chowk- Swargate. #include <stdlib.h>
#include <string.h>
// Define a structure for the decision tree node
typedef struct Node {
char *question;
struct Node *yes;
struct Node *no;
char *result;
} Node;

// Function to create a new tree node


Node* createNode(char *question, char *result)
{
Figure 1 PMPML Bus Route from Saswad to Node *newNode = (Node *) malloc (sizeof(Node));
Swargate(Pune) newNode->question = question;
newNode->yes = NULL;
2.1.2. Total Time Taken newNode->no = NULL;
Total Time Taken for Route 1- 1 hr 12 mins newNode->result = result;
Total Time Taken for Route 2- 1 hr 37 mins return newNode;
Decision tree supports the partitioning structure i.e., }
tree model. the algorithm here displays the analysis // Function to build a sample decision tree for two
on time, in the given decision tree source and routes
destination are the two places of pune city, where the Node* buildTree() {
source is Saswad town and destination is Swargate // Create leaf nodes for the routes
pune city. Here the decision tree gives us a brief idea Node *route1 = createNode(NULL, "Take Route
about the branches with specified rule (Time). By 1");
analyzing the source and destination, there are two Node *route2 = createNode(NULL, "Take Route
specific paths as mentioned. Implementing the above 2");
decision tree in C language, to analyze the Pune
Municipal Transport (PMT) bus system, which will // Create decision nodes
help in making decisions based on various factors, Node *timeDecision = createNode("Is travel time
such as route selection, bus timing, or passenger less than 30 mins?", NULL);
demand. A decision tree consists of nodes Node *passengerDecision = createNode("Are there
representing decisions or outcomes based on certain more than 10 passengers?", NULL);
attributes. In our case, Figure 1 shows PMPML Bus
Route from Saswad to Swargate(Pune) such as // Build the tree structure
distance, time, and passenger count. Below is a timeDecision->yes = route1; // If yes, take Route 1
simplified example of how to implement a basic timeDecision->no = passengerDecision; // If no,
decision tree in C Language, Shown in Figure 2 & 3. check passenger count

IRJAEM 3257
International Research Journal on Advanced Engineering e ISSN: 2584-2854
Volume: 02
and Management Issue: 11 November 2024
https://goldncloudpublications.com Page No: 3256-3260
https://doi.org/10.47392/IRJAEM.2024.0479

passengerDecision->yes = route2; // If yes, take 3. Dijkstra's Algorithm


Route 2 Dijkstra's algorithm is designed to find the shortest
passengerDecision->no = route1; // If no, take paths from a starting node to all other nodes in a
Route 1 (fallback) graph, with non-negative edge weights in kilometres.
return timeDecision; The algorithm uses a priority queue to explore nodes
} based on the cumulative cost from the start node [3].
// Function to traverse the tree and make a decision 3.1. Graph Representation
void makeDecision(Node *node) { As Dijkstra’s algorithm is used for directed as well as
if (node->result! = NULL) { undirected graphs, which is also implemented in the
printf("%s\n", node->result); Pune Metro System. Where all stations are nodes and
return; routes are paths or edges which are connected
} between two stations. So according to stations, travel
char answer [4]; time and distance change.
printf("%s (yes/no): ", node->question);
scanf("%s", answer);
if (strcmp(answer, "yes") == 0) {
makeDecision(node->yes);
} else {
makeDecision(node->no);
}
}

// Main function
int main () {
// Build the decision tree
Node *decisionTree = buildTree();
printf("Decision Tree for Pune PMT Bus
Routes:\n");
makeDecision(decisionTree); Figure 4 Pune Metro Map [4]
return 0;
} In the context of the Pune Metro, the graph can be
represented as follows:
• Nodes: Metro stations (e.g., PCMC,
Swargate, Shivajinagar).
• Edges: Tracks between the stations, with
Figure 2 Result weights representing travel time or distance.
3.1.1. Assuming Some Stations and
Travel Times
PCMC: [(Sant Tukaram Nagar, 5), (Kasarwadi, 10)]
Sant Tukaram Nagar: [(PCMC, 5), (Pune Junction,
Figure 3 Result 15)] Kasarwadi: [(PCMC, 10), (Pune Junction, 8)]
Pune Junction: [(Sant Tukaram Nagar, 15),
(Swargate, 20)] Swargate: [(Pune Junction, 20)]
3.2. Dijkstra’s Algorithm Implementation
Here’s a simplified implementation in C Language to
Figure 4 Result find the shortest path in the Pune Metro network [2].

IRJAEM 3258
International Research Journal on Advanced Engineering e ISSN: 2584-2854
Volume: 02
and Management Issue: 11 November 2024
https://goldncloudpublications.com Page No: 3256-3260
https://doi.org/10.47392/IRJAEM.2024.0479

#include <stdio.h> // and the total weight of path from src to v


#include <limits.h> through u is smaller than the current value of dist[v]
#include <stdbool.h> if (!sptSet[v] && graph[u][v] && dist[u] !=
#define V 5 // Number of vertices in the graph INT_MAX && dist[u] + graph[u][v] < dist[v]) {
// Function to find the vertex with the minimum dist[v] = dist[u] + graph[u][v];
distance }
int minDistance(int dist[], bool sptSet[]) { }
int min = INT_MAX, min_index; }
for (int v = 0; v < V; v++) { // Print the constructed distance array
if (!sptSet[v] && dist[v] <= min) { printf("Vertex\tDistance from Source\n");
min = dist[v]; for (int i = 0; i < V; i++) {
min_index = v; printf("%d\t\t%d\n", i, dist[i]);
} }
} }
return min_index;
} // Main function to test the above functions
int main() {
// Function to implement Dijkstra's algorithm // Example graph represented as an adjacency
void dijkstra(int graph[V][V], int src) { matrix
int dist[V]; // Output array. dist[i] holds the shortest int graph[V][V] = {
distance from src to j {0, 5, 0, 0, 10},
bool sptSet[V]; // sptSet[i] will be true if vertex i is {5, 0, 0, 15, 0},
included in the shortest path tree {0, 0, 0, 20, 0},
{0, 15, 20, 0, 25},
// Initialize all distances as INFINITE and sptSet[] {10, 0, 0, 25, 0}
as false };
for (int i = 0; i < V; i++) {
dist[i] = INT_MAX; dijkstra(graph, 0); // Starting from vertex 0
sptSet[i] = false; (PCMC)
} return 0;
}
// Distance from source to itself is always 0
dist[src] = 0;

// Find the shortest path for all vertices


for (int count = 0; count < V - 1; count++) {
// Pick the minimum distance vertex from the set
of vertices not yet processed
int u = minDistance(dist, sptSet); Figure 5 Result
sptSet[u] = true; // Mark the picked vertex as 4. Disadvantage
processed Above mentioned code of Decision Tree and Dijkstra
// Update dist value of the adjacent vertices of Algorithm, are well defined for the implementation in
the picked vertex numerical analysis, for finding the shortest route
for (int v = 0; v < V; v++) { between the source and destination, but there are few
// Update dist[v] if and only if it is not in dis-advantage of the both algorithms, which are listed
sptSet, there is an edge from u to v, below, Shown in Figure 4 & 5.

IRJAEM 3259
International Research Journal on Advanced Engineering e ISSN: 2584-2854
Volume: 02
and Management Issue: 11 November 2024
https://goldncloudpublications.com Page No: 3256-3260
https://doi.org/10.47392/IRJAEM.2024.0479

4.1. Decision Tree map.aspx


• They are largely unstable compared to other [5] Dijkstra's-Algorithm. (n.d.). https://www.
decision predictors. A small change in data geeksforgeeks.org/why-does-dijkstras-
can result in a major change in the structure of algorithm-fail-on-negative-weights/.
the decision tree
• Use quantitative data only, and ignore
qualitative aspects of decision.
4.2. Dijkstra Algorithm
• Non-Negative Weights Only: Dijkstra's
algorithm works only with graphs that have
non-negative edge weights. If there are
negative weights, the algorithm can produce
incorrect results [5]
• Single Source: Dijkstra’s algorithm finds the
shortest path from a single source to all other
vertices, which might not be efficient if only
the shortest path to a specific destination is
needed.
Conclusion
This simple decision tree implementation in C
Language can help analyse decision-making
processes for the Pune PMT bus system based on
user-defined criteria. You can expand the tree with
more complex questions and routes as needed.
This implementation of Dijkstra's algorithm in C
Language provides a foundational approach to
finding the shortest paths in a graph, applicable to
scenarios like metro systems. You can modify the
graph matrix to represent different metro networks as
needed.
References
[1] Time Table. (n.d.). https://pmpml.org/
assets/schedule/170866629042bbb3b37009c
5fd5bea2b0df59c1b62.pdf
[2] 1st-year-study-materials-vssut/let-us-c-by
yashvant- kanetkar.pdf at master
msatul1305/1st-year-study-materials-vssut.
(n.d.). GitHub. Retrieved October 29,2024,
from https://github.com/msatul1305/1st-year-
study-materials-vssut-study-materials-
vssut/blob/master/ let-us-c-by-yashavant-
kanetkar.pdf
[3] Rosen, K. (n.d.). Discrete Mathematics and its
applications. (Seventh Edition ed.). Tata
McGraw Hill.
[4] (n.d.).https://punemetrorail.org/route-

IRJAEM 3260

You might also like