My question is about service composition. But I didn’t find a solution similar to mine.
Problem description:
- Each service has its own type and declares its dependent service type (The number of dependencies is uncertain, it can also have no dependencies)
- Services of the same type may declare different dependencies. For example, serviceA and serviceB are of the same type, but serviceA declares a dependency on typeA, while serviceB declares a dependency on typeB.
- A complete service is a tree structure, and no leaf nodes declare dependencies.
- The constraint is: in a tree structure, the paths from the root node to any node cannot have the same type.
- Each service has its own score, and the score of a service is affected by its parent service (if any). That is, different parent services will affect the scores of child services.
Enter a type, The algorithm needs to select the service with the highest total score from this type of service (needs to be a complete tree structure). The total score is the sum of the scores of all services in the tree.
The above problems arise from: For example, service A depends on type A, and service B of the same type depends on type B. I hope that there can be different tree structures to implement the same function (that is, the functions provided by services of the same type are the same)
But at present, this problem is very difficult. I looked up articles about service composition. I found that the structure of the service composition is fixed. It is very different from mine. I tried genetic algorithms, but found it very difficult to initialize the population.
So I come here for help, hoping someone can answer my question or give me a hint.
But at present, this problem is very difficult. I looked up articles about service composition. I found that the structure of the service composition is fixed. It is very different from mine. I tried genetic algorithms, but found it very difficult to initialize the population.
In fact, the greedy algorithm is effective, but I hope there will be other algorithms to compare with the greedy algorithm.
wtq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2