Skip to content

Commit

Permalink
Pseudo code
Browse files Browse the repository at this point in the history
  • Loading branch information
antongiacomo committed Apr 30, 2024
1 parent 3052fbe commit 4dec799
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metrics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ \subsection{Heuristic}\label{subsec:heuristics}

The function SlidingWindowHeuristic processes a list of vertices, each associated with a list of services, to identify optimal service combinations using a sliding window approach, given the constraints set by parameters verticesList and w (window size).

Initially, the function establishes $\text{G'}$ to store the optimal services or combinations identified during the process (line 2). It iterates from the start to the feasible end of the vertex list to ensure each possible window of services is evaluated (line 3). For each window, the function initializes minMetric to infinity and an empty list minMetricCombination to store the best service combination found within that specific window (line 5-6).
Initially, the function establishes $\text{G'}$ to store the optimal services or combinations identified during the process (line 2). It iterates from the start to the feasible end of the vertex list to ensure each possible window of services is evaluated (line 3). For each window, the function initializes minMetric to infinity and an empty list minMetricCombination to store the best service combination found within that specific window (line 5-6).

Within each window, the function iterates through the vertices (line 7), calculating the total metric for services in the current vertex (lines 10-12). It then determines the average metric for these services and checks if this average is the lowest encountered so far within the current window (lines 13-15). If so, it updates minMetric and records the current combination as the best for this window.

Expand Down

0 comments on commit 4dec799

Please sign in to comment.