Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Name: _____________________ Student Id: _______________

CS 585
Final Exam Solution (Spring 2023)
2 hours

Total points: 125

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)

Figure 1. Composition structure patterns

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.

Figure 2. Abstract service class graph of composite service

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)

Path, p Utility, F(p) Cost, Q(p)


P(s11) ={vs->s11} F(vs->s11) =212 Q(vs->s11) =100
P(s12) ={vs->s12} F(vs->s12) = 350 Q(vs->s12) =250
P(s21) ={vs->s11->s21, F(vs->s11->s21) = 407 Q(vs->s11->s21) = 300
vs->s12->s21 } F(vs->s12->s21) = 545 Q(vs->s12->s21) = 450
P(s31) ={vs->s11->s21->s31 F(vs->s11->s21->s31) = 557 Q(vs->s11->s21->s31) = 450 –
vs->s12->s22 -> s31 } F(vs->s11->s22->s31) = 695 – Not feasible

vs->s11->s21->s31 (Not Feasible Q(vs->s12->s21->s31) = 600 –


because QoS constraint Not feasible
violated)

2
Name: _____________________ Student Id: _______________

vs->s12->s21->s31 (Not Feasible


because QoS constraint
violated)
P(s31) ={vs->s11->s21->s32 F(vs->s11->s21->s31) = 607 Q(vs->s11->s21->s31) = 500 –
vs->s12->s22 -> s32 } F(vs->s11->s22->s31) = 745 – Not feasible

vs->s11->s21->s32 (Not Feasible Q(vs->s12->s21->s31) = 650 –


because QoS constraint Not feasible
violated)

vs->s12->s21->s32 (Not Feasible


because QoS constraint
violated)
P(s31) ={ }

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)

If the overall cost constraint is removed, the optimization problem becomes an


unconstrained optimization problem. Specifically in this case, removal of cost constraint
transforms the problem into a shortest path problem since there is no cycle in the graph.
Hence any single source shortest path algorithm can be used to compute the optimal
solution.

The students are also required to write the algorithm in pseudocode.

Q2. Web service operation mapping problem (35 points)

Refer to the following paper:

3
Name: _____________________ Student Id: _______________

A. Afzal, B. Shafiq, S. Shamail, A. Elahraf, J. Vaidya and N. Adam, “ASSEMBLE:


Attribute,Structure and Semantics based Service Mapping Approach for Collaborative Business
Process Development”. IEEE Transactions on Services Computing, 2021.

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:

{𝑪𝟏 : orderId, 𝑪𝟐 : orderStatus, 𝑪𝟑 : taxAmount, 𝑪𝟒 : shippingCharges, 𝑪𝟓 : totalAmount}

𝑪𝟏 𝑪𝟐 𝑪𝟑 𝑪𝟒 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:

Below are the correct mappings:

4
Name: _____________________ Student Id: _______________

𝑚1 = {< 𝑎1 , 𝐶2 >, < 𝑎2 , 𝐶1 >, < 𝑎5 , 𝐶5 >}


𝑚2 = {< 𝑎1 , 𝐶2 >, < 𝑎2 , 𝐶1 >, < 𝑎4 , 𝐶4 >}
𝑚3 = {< 𝑎1 , 𝐶1 >, < 𝑎2 , 𝐶2 >, < 𝑎3 , 𝐶3 >, < 𝑎5 , 𝑐5 >}
𝑚6 = {< 𝑎1 , 𝐶1 >, < 𝑎2 , 𝐶2 >, < 𝑎3 , 𝐶3 >, < 𝑎4 , 𝐶4 >}
𝑚7 = {< 𝑎1 , 𝐶1 >, < 𝑎3 , 𝐶3 >, < 𝑎4 , 𝐶4 >, < 𝑎5 , 𝐶5 >}

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)

Maximize −(𝑃1 𝑙𝑜𝑔𝑃1 + 𝑃2 log 𝑃2 + 𝑃3 log 3 + 𝑃6 log 𝑃6 + 𝑃7 log 𝑃7 )

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.

Q3. Service Composition (45 points)

Refer to the following paper:

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)

Service Name Input parameter Output parameter


authorizeRider authorization_token rider_id
device_id
verifyPickupLocation current_location pickup_geolocation
verifyDestinationLocation dest_address destination_geolocation
requestRideEstimates pickup_geolocation fare_id
destination_geolocation
promo_code
requestRide rider_id request_id
pickup_geolocation
destination_geolocation
fareId
getTripStatus request_id trip_status

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)

Figure 3. Petri net structure

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

c. Given the following vectors:


X1 = [1 1 1 0 1 1 0]T

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.

Q4. Knowledge-driven BPs (10 points)

a. Discuss the unique characteristics of knowledge-driven BPs and how are they different
from structured BPs? (5 Points)

b. Why an emergency response process is considered as a knowledge-driven BP? (5 Points)

You might also like