Question: MAKE SURE TO EXPLAIN DESIGN AND WHY THE PROGRAM IS THIS WAY: PATH VECTRO ROUTING: Need to implement and do a full program for PVR
MAKE SURE TO EXPLAIN DESIGN AND WHY THE PROGRAM IS THIS WAY:
PATH VECTRO ROUTING: Need to implement and do a full program for PVR in Java or C++. Also an output should be uploaded along with an explanation of the code and the reaason of why its designed the way you did.
pseudo code:
Path_Vector_Routing()
{
// Initialization
for (y = 1 to N)
{
if (y is myself)
Path[y] = myself
else if (y is a neighbor)
Path[y] = myself + neighbor node
else
Path[y] = empty
}
Send vector {Path[1], Path[2], ..., Path[y]} to all neighbors
// Update
repeat (forever)
{
wait (for a vector Pathw from a neighbor w)
for (y = 1 to N)
{
if (Pathw includes myself)
discard the path // Avoid any loop
else
Path[y] = best {Path[y], (myself + Pathw[y])}
}
If (there is a change in the vector)
Send vector {Path[1], Path[2], ..., Path[y]} to all neighbors
}
} // End of Path Vector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
