Match Spotlight Card Algorithm Development
The algorithm is designed to rank cricket matches based on multiple parameters to
determine their (TRP) priority that correctly combines priority parameters to determine the
TRP priority, effectively prioritising matches based on the given parameters. We used a
weighted sum approach, normalising weights to ensure they add up to 1.
Overview
What I did is implemented a function for finding the status(Live, Upcoming or Completed)
based on the given current_timestamp. And then calculated the weighted average priority
score for each of the priority features & then took the sum of this priority score resulting in
the final TRP/priority score for each match in the given excel sheet. Anf based on that, I
implemented a priority queue with max-heap to get the match with the highest priority at the
top and so on.
Explanation
1. We start by reading the match data from an Excel file. The current_timestamp is used
to determine the status of each match (Live, Upcoming, or Completed) by comparing
the current time with the match's start and finish times.
2. Each match is assigned a priority score based on the following parameters and
combined these priority parameters using a weighted sum approach, considering:
● Teams (max priority val achieved - 0.095)
● Time (max priority val achieved - 0.0399)
● Gender (max priority val achieved - 0.0649)
● Match Type (max priority val achieved - 0.06 )
● League (max priority val achieved - 0.1)
● Number of Teams (max priority val achieved - 0.01)
● Match Category (max priority val achieved - 0.13)
● Status (max priority val achieved - 0.4)
● Special Match (max priority val achieved - 0.1)
● Rivalries
Assumptions and Simplifications made
1. Only a predefined set of leagues is considered. Leagues not listed are given a lower
default priority. Otherwise different leagues are given priority accordingly.
2. Completed matches are shown only if they fall within daytime hours (08:00 - 20:00).
Matches outside this period are excluded to maintain relevance. (as mentioned in the
instructions below the excel sheet)
Edge cases handled -
1. Live matches are prioritized over other statuses. If there are more than three
completed matches, only the top three based on priority are displayed.
2. Completed matches are filtered out during non-daytime hours to ensure current
relevance.
3. Also displayed the upcoming matches which are 24 hours before match start time.
4. The weighted scoring system resolves conflicting priorities. Factors with higher
weights, such as status, have a greater impact on the final priority score.
Output
The final output is a sorted list of matches based on their priority, with the highest priority
matches first. The output includes the match number, date, time, teams, location, gender,
league/event, priority, and status.
By combining these components, our algorithm effectively prioritizes matches based on the
given parameters, handles edge cases and conflicting priorities, and displays match cards
24 hours before the match start time.