Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need an adaptive decision making program with decision tree (no matter which p

ID: 3781372 • Letter: I

Question

I need an adaptive decision making program with decision tree (no matter which programming language you write in)

1) Decision tree should be about anything. All nodes (except root node) should have priority tags for example after root node, there are 3 internal nodes (2-3-4) and from left to right they have priority tags like 0.9 - 0.8 - 0.7 so system should start searching and calculating from 0.9 because it is greater than the others. You can use any sample if you have or find for writing program, check the example below, either you can use it or use another tree with predefined priority tags by you.

2) System should have simple user interface. User select one of solutions (leaf nodes like 14-15-16-17-18-19-20-21-22) in the example tree.  After User selects one of leaf nodes, Our program start searching from root node (1) to selected leaf node (lets say 17) and then Program starts to find best chain according to calculated priority tags and program shows us results like '' Best Chain Results: 1-3-8-17 "

Note: The program is not an Artificial Intelligence system , It is an Adaptive system.

All i need is a simple properly working source code for such system (maybe exactly same for this example) and a proof such as screenshot if possible

0.9 2 0,8 0.9 14 15 16 0.9 0.7 0.8 0.9 0.9 10 0.7 0.9 0.8 0.9 0.8- 17 18 19 12 0.7

Explanation / Answer

the priority tags can be seen as weights of an edge.

then the best chain = the chain with highest weight.

i.e to go to leaf node 14 in the highest prority way, we'll go fromm root 1 to 2 (0.9 highest weight among all choices) then to 5 (0.9 again highest choice) then 14 (0.9 again)

hence we have converted the program to oppposite of the shortest weight path problem. Just calculate the path with the most weight = answer~

-----------

Algorithm -

1) create a set to store the nodes . initialze it to empty.

2) intialize all distance to 0 (lleast priority) . Assign the value of the root as INFINITE so that it is picked firtst.

3) while the set doesnot consist off all vertices you do -

           i) Pick a node not in the set with max weight (say u)

            ii) include u to the set.

         iii) update the weights of all adjacent nodes to u , To update the weights, iterate through all adjacent nodes For every adjacent node v, if sum of distance value of u (from source) and weight of edge u-v, is less than the weight value of v, then update the weight value of v.

dist[i] to store distances of the max weigh of the node 0 - i ( i.e dist[14] will store 0.9 + 0.9 + 0.9 for the path 0 -14)

path[v] will store the nodes traversed ( i.e path[14] will store 1, 2, 5, :14 )

---------

#include <stdio.h>
#include <limits.h>
#define V 9
int maxDistance(double dist[], bool sptSet[]);
double printSolution(double dist[], double n)
{
   printf("Max weight distance of all nodes including leaves from source ");
   for (int i = 0; i < V; i++)
      printf("%d %lf ", i, dist[i]);
}


void priority_test(double graph[V][V],int src)
{
     double dist[V];
      double path[V];

     bool sptSet[V];


     for (int i = 0; i < V; i++)                                        //initialize the distance as mentioned in the algo
        dist[i] = 0, sptSet[i] = false;

     dist[src] = INT_MAX;

     for (int count = 0; count < V-1; count++)
     {
       int u = maxDistance(dist, sptSet);                               //need to pick the max distance or highest priority!

       sptSet[u] = true;

       for (int v = 0; v < V; v++)

         if (!sptSet[v] && graph[u][v] && dist[u] != INT_MAX            //only add the vertex if the new vertex gives a path GREATER
                                       && dist[u]+graph[u][v] >= dist[v])
        {    dist[v] = dist[u] + graph[u][v];

                path[v]=u;
        }
}

     printSolution(dist, V);
}

int main()
{

/* the graph looks like
      
          0.2   0.3
      (0)--(1)--(2)
       |   /    |
      0.6| 0.8/ .5 |0.7
       | /     |
      (3)-------(4)
            0.9     


*/

double graph[V][V] = {{0, 0.2, 0, 0.6, 0},
                      {0.2, 0, 0.3, 0.8, 0.5},
                      {0, 0.3, 0, 0, 0.7},
                      {0.6, 0.8, 0, 0, 0.9},
                      {0, 0.5, 0.7, 0.9, 0},
                     };

    priority_test(graph, 0);

    return 0;
}

int maxDistance(double dist[], bool sptSet[])
{
   double max = 0, max_index;

   for (int v = 0; v < V; v++)                                  //intializing as discussed in the algo above
     if (sptSet[v] == false && dist[v] >= max)
         max = dist[v], max_index = v;

   return max_index;
}
---------------

thank yoy

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote