Professional Documents
Culture Documents
CS585 FinalExam Spring2023 Solution
CS585 FinalExam Spring2023 Solution
CS 585
Final Exam Solution (Spring 2023)
2 hours
Note:
1. You can view the lecture slides and relevant research papers available on course LMS
site to solve the exam questions. Viewing of any other material is not allowed.
2. This exam has 14 pages. Make sure that you have received all 14 pages.
Q1. For this question, we will follow the Web service composition structure patterns discussed in
Yu et al. ACM Transactions on Web paper. These structure patterns are shown in Figure 1.
S2 S2
S1 S2 S1 S1
Sn Sn
(a) sequential (b) AND Split (fork) (c) XOR Split (Conditional)
S1 S1
K
Sn+1 Sn+1
S2
Sn Sn
(d) Loop (e) AND Join (Merge) (e) XOR Join (Trigger)
Consider the abstract service class (function) graph of the composite service shown in Figure
2. In this figure Si represents the service class and sij in the table denote the jth candidate service
that can provide the functionality needed for the ith service class. The table in this figure lists
the utility and cost parameters for each atomic service sij.
For the composite service shown in Figure 2, formulate the optimal service selection problem
as a Multi-constraint shortest path (MCSP) problem with the objective of maximizing utility
1
Name: _____________________ Student Id: _______________
subject to the constraint that the overall cost for executing the entire composite service must
be less than 450. (35 Points)
a. Draw the candidate service graph and label the edges with the utility and QoS
parameters of the corresponding candidate service. (5 points).
b. Show the result of running the MCSP Algorithm (given in Section 4.2) of the paper
on your candidate service graph. You need to show all the paths retained by the MCSP
algorithm at each node of the candidate service graph and the utility and cost value of
each of these paths. (15 Points)
2
Name: _____________________ Student Id: _______________
c. Discuss the complexity of the MCSP Algorithm in terms of the number of 𝑛 and 𝑚,
where, 𝑛 denotes the number of service classes and 𝑚 denotes the maximum number
of candidate services in any service class (5 Points)
Given 𝑛 service classes with a maximum of 𝑚 candidate services in each class, the number
of paths from source to destination in the candidate service graph is 𝑂(𝑛𝑚 ). Hence the
complexity of MCSP Algorithm is 𝑂(𝑛𝑚 ).
d. Suppose that the constraint on the overall cost of the composite service to be less than
450 is dropped. Can you obtain an optimal solution that maximizes utility using a
greedy algorithm? If so, write your greedy algorithm. (10 points)
3
Name: _____________________ Student Id: _______________
Let x: create_Invoice be a Web service operation in a business process with its mediated attributes
(i.e., attribute clusters in the global mediated schema) given below:
𝑪𝟏 𝑪𝟐 𝑪𝟑 𝑪𝟒 shipAmt, 𝑪𝟓
ordId, Odr_Id, OrdStat, OStatus, taxCharged, shipCharge, totalAmnt, total,
OrdNum, ,… Order_St, … taxAmt, tax, … shipQuote, … totl_Amount…
Let s: genInvoice be an available Web service operation in the user organization, with the
following attribute set: ...
{𝒂𝟏 : OrdNo, 𝒂𝟐 : OrdSt, 𝒂𝟑 : salesTax, 𝒂𝟒 : shipmentAmt, 𝒂𝟓 : ordAmnt}
a. Given the set of following attribute correspondences (CORRM) between the BP operation
x and user organization operation s:
CORRM = { ‹𝑎1 , 𝐶1 › 𝜎11 : 0.65,
‹𝑎1 , 𝐶2 › 𝜎12 : 0.35,
‹𝑎2 , 𝐶1 › 𝜎21 : 0.35,
‹𝑎2 , 𝐶2 › 𝜎22 : 0.15,
‹𝑎3 , 𝐶3 › 𝜎33 : 0.65,
‹𝑎4 , 𝐶4 › 𝜎44 : 0.75,
‹𝑎4 , 𝐶5 › 𝜎45 : 0.21,
‹𝑎5 , 𝐶2 › 𝜎52 : 0.24,
‹𝑎5 , 𝐶5 › 𝜎55 : 0.75 }
Which of the following are the possible attribute mappings that are consistent with the
mediated schema? (10 Points)
𝑚1 = {< 𝑎1 , 𝐶2 >, < 𝑎2 , 𝐶1 >, < 𝑎5 , 𝐶5 >}
𝑚2 = {< 𝑎1 , 𝐶2 >, < 𝑎2 , 𝐶1 >, < 𝑎4 , 𝐶4 >}
𝑚3 = {< 𝑎1 , 𝐶1 >, < 𝑎2 , 𝐶2 >, < 𝑎3 , 𝐶3 >, < 𝑎5 , 𝑐5 >}
𝑚4 = {< 𝑎1 , 𝐶2 >, < 𝑎2 , 𝐶2 >, < 𝑎3 , 𝐶4 >, < 𝑎4 , 𝐶5 >}
𝑚5 = {< 𝑎1 , 𝐶2 >, < 𝑎1 , 𝐶1 >, < 𝑎3 , 𝐶4 >, < 𝑎4 , 𝐶5 >}
𝑚6 = {< 𝑎1 , 𝐶1 >, < 𝑎2 , 𝐶2 >, < 𝑎3 , 𝐶3 >, < 𝑎4 , 𝐶4 >}
𝑚7 = {< 𝑎1 , 𝐶1 >, < 𝑎3 , 𝐶3 >, < 𝑎4 , 𝐶4 >, < 𝑎5 , 𝐶5 >}
𝑚8 = {< 𝑎1 , 𝐶1 >, < 𝑎2 , 𝐶2 >, < 𝑎3 , 𝐶3 >, < 𝑎4 , 𝐶4 >, < 𝑎5 , 𝐶2 >}
Solution:
4
Name: _____________________ Student Id: _______________
b. Based on your answer to Part (a), formulate the problem of computing probabilities of
attribute mappings as an entropy maximization problem. You need to provide the objective
function and all the constraints in terms of the corresponding attribute mapping
probabilities. (15 points)
Subject to:
Constraint 1:
0 ≤ 𝑃1 ≤ 1
0 ≤ 𝑃2 ≤ 1
0 ≤ 𝑃3 ≤ 1
0 ≤ 𝑃6 ≤ 1
0 ≤ 𝑃7 ≤ 1
Constraint 2:
𝑃1 + 𝑃2 + 𝑃3 + 𝑃6 + 𝑃7 = 1
Constraint 3:
𝑃3 + 𝑃6 + 𝑃7 = 0.65
𝑃1 + 𝑃2 = 0.35
𝑃3 + 𝑃6 = 0.15
𝑃3 + 𝑃6 + 𝑃7 = 0.65
𝑃2 + 𝑃6 + 𝑃7 = 0.75
𝑃1 + 𝑃3 + 𝑃7 = 0.75
c. In Section 3.4 of the paper, a Colored Petri net (CPN) reachability analysis approach is
discussed for semantic resolution of operation mapping conflicts. As stated in Section 3.4.1
of the paper, “the basic idea of this approach is to explore those paths in the reachability
tree that satisfy the precondition of a given user organization operation mapped to the BP
operation. For any given mapped operation, if no such path exists from the initial state
corresponding to the start of the BP, then the mapping is considered incorrect.”
Explain what is meant by the path in the reachability tree that satisfy the precondition of a
given user organization operation mapped to the BP operation. Also, explain why non-
existence of such a path in the reachability tree imply that the given mapping between the
user organization operation and BP operation is incorrect. (10 Points)
5
Name: _____________________ Student Id: _______________
The reachability tree represents all the paths reachable from the given initial state (making). We
are particularly interested in finding any path from the initial state in which the pre-conditions of
the mapped user organization operation are satisfied. If no such path exist, then we cannot reach a
state from the given initial state that satisfies the pre-conditions of the mapped user organization
operation. Hence, the mapped user organization operation cannot be executed during any
instantiation of the resulting BP. Therefore, the mapping between the user organization operation
and BP operation is incorrect.
Jiujun Cheng, Cong Liu, MengChu Zhou, Qingtian Zeng, and Antti Ylä-Jääski. "Automatic
composition of semantic web services based on fuzzy predicate petri nets." IEEE Transactions
on Automation Science and Engineering, Vol. 12, no. 2 (2015): 680-689.
a. Given the following atomic web services, set of facts, and goal, draw a Petri net model
for service composition. (20 points)
Facts:
→ authorization_token
→ device_id
→ current_location
→ dest_address
→ promo_code
Goal:
trip_status →
6
Name: _____________________ Student Id: _______________
b. Given the Petri net structure in Figure 2, find the incidence matrix. (10 points)
Incidence Matrix:
t1 t2 t3 t4 t5 t6 t7
P1 1 -1 0 0 0 0 0
P2 1 0 -1 -1 0 0 0
P3 0 1 0 0 -1 0 0
P4 0 0 1 0 -1 0 0
7
Name: _____________________ Student Id: _______________
P5 0 0 0 1 0 -1 0
P6 0 0 0 0 1 0 -1
P7 0 0 0 0 0 1 0
X2 = [1 1 1 0 1 0 1]T
X3 = [1 1 1 0 0 0 1]T
Which of X1, X2, X3 is the transition invariant (T-invariant) for the Petri net structure
given in Figure 2 in part (b)? (10 points)
X2 = [1 1 1 0 1 0 1]T
d. Suppose that there exist multiple T-invariant vectors for a Petri net structure corresponding
to a composite service. However, the element corresponding to the goal transition in all of
these T-invariant vectors is ZERO. What can you say about the composite service? Is it
realizable? Explain your answer. (5 points)
If there does not exist any T-invariant vector of a Petri-net structure with non-zero goal
transition then the composite service cannot be realized. The goal transition is potentially
fireable if and only if there exists a non-negative T-invariant with non-zero goal transition. If
such T-invariant does not exist then the goal transition cannot be fired in the given Petri net
structure. Hence the composite service is not realizable.
a. Discuss the unique characteristics of knowledge-driven BPs and how are they different
from structured BPs? (5 Points)