Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write pseudocode or Python for a thumbs up. :) 1 Q1 We are given a set of n spies each of whom needs to
Please write pseudocode or Python for a thumbs up. :)
1 Q1 We are given a set of n spies each of whom needs to meet exactly one messenger from a set of n messengers and a set of possible locations [l] = {1,... ,l} where they can meet. For each spy i, there is a subset Si C [l] of the possible locations where spy i can go. Similarly, there is a subset Mi C [l] of the possible locations where messenger i can go. Moreover, each location j can handle at most cj pairs of spy-messenger meetings. The task is to decide if there is a possible way to match up spies and messengers such that every pair meets at one of their common locations. Formally, does there exist a permutation o on n vertices (mapping spies to messengers) and a function f : [n] [l] mapping spies to locations such that 1. Vi [n], f(i) e Sin Mo(i) (every spy-messenger pair meets at a location which they can both visit) 2. Vj E [l],{i | f(i) = j}Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started