Question: So I need a python code which will traverse a graph and will return the time complexity. We will pick a random attack path from
So I need a python code which will traverse a graph and will return the time
complexity. We will pick a random attack path from root to leaf. Let's say the attack
path will be Now the program will calculate the risk of P and
store it also it will count the vulnerabilities lying in P and will store it The program
will set P as the optimal path, "Popt" and the risk as optimal as well which is "Ropt
R Then, the program will take another attack path which is P and it will select
the next leaf node from the first path. Means, if P is is this
one, then P will bemeans the next leaf node of V Now, it
will calculate the risk of P store the risk, calculate the number of vulnerabilities in
and store it as well. Now, it will compare the risks of and If is greater
than RP it will update the current optimal: Popt and Ropt Else,
take another new path to check with the current optimal but this time, don't take
any nodes from the leaf anymore, move level up and take path like: V VVV
So in this way, the program should continue, and keep checking the whole tree. And
at the end of traversing, the program should be able to return the time complexity,
the attack path with highest risk and the set of associated vulnerabilities in that
path.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
