42206

one Local Olampyad Questions on Informatic in 2011

An agent is works between n producer and m consumers. ith producer, generates s_i (product like candy) candy and jth consumer consumes (like eat!) b_j candy in this year. For each candy that sales, agent get 1 dollar payoff. For some problems, one strict rule was defined that a producer should be sales candy to any producer that the distance between them is not greater than 100 KM (kilometers). if we have list of all pairs of producer-consumer that the distance between them is lower than 100 KM, which of the following algorithm is goof for finding maximum payoffs? (suppose s_i and b_j may be becomes very large).

1) Maximal Matching 2) Dynamic Programming 3) Maximum Flow 4) 1 , 3

one User ask it here:

A Dynamic Programming or Graph Algorithm, a Nice Questions

but i think the answer is false. i need the expert man who help whole competitor.

Answer1:

A good solution is the one that uses a maximum flow. The graph is constructed as follows: the left part corresponds to the producers and the right part - to the consumers. There should an edge from the source vertex to each of the producers with s_i capacity. There should also be an edge from each consumer to the sink node with b_j capacity. And there should be an edge of an infinite capacity between a producer and a consumer if they are located close to each other. The answer is the size of the maximum flow from the source to the sink. It possible to find the maximum flow in polynomial time(it is a polynomial of the number of consumers and producers) regardless of the values of s_i and b_j.

A solution with a maximum matching is bad because it requires (sum of s_i and b_j) edges. It is not feasible if s_i and b_j are big.

A dynamic programming solution is not good because it is likely that there is no polynomial dynamic programming solution at all.

Recommend

  • Retry on database exception using php
  • Jquery function closing div on append by itself
  • MySQL calculating distance (simple solution)
  • SQL search using Haversine in Doctrine
  • How to save a leaflet map with drawn shapes/points on it in Shiny?
  • best practice data design in firebase
  • What is the unit of measurement used in MySQL's spatial Buffer call?
  • MySQL Function to calculate distance between two latitudes and longitudes [closed]
  • Does it make sense to use both countvectorizer and tfidfvectorizer as feature vectors for text clust
  • Distance from long lat line segment wrong over long distances [duplicate]
  • Flot - Is it possible to have a third y-axis or hidden data set?
  • OpenCV Max Detection Range
  • Matlab Image and Plot with Unexpected Flip
  • IOS sort NSMutableArray for a numeric field
  • What causes erratic GPS estimates during certain time intervals?
  • link library to all targets in cmake project
  • Returning semi-unique values from a list
  • Android gcm notification payload vs data payload?
  • c++ search a vector for element first seen position
  • Regex for nested values
  • How gzip file gets stored in HDFS
  • How to get the date of next specified day of week
  • Is it possible to define rest argument in OCaml?
  • Shouldn't else be indented in the below code
  • Python cosine function precision [duplicate]
  • Setting the run time properties on SpringApplicationBuilder()
  • UWP/C# - Issue with AQS and USB Devices
  • How to make JSON.NET deserialize to Microsoft Date Time?
  • RxJava debounce by arbitrary value
  • Why Encoding.ASCII != ASCIIEncoding.Default in C#?
  • Time complexity of a program which involves multiple variables
  • How to avoid particles glitching together in an elastic particle collision simulator?
  • Finding past revisions of files in StarTeam w/ .NET SDK / C#
  • When should I choose bucket sort over other sorting algorithms?
  • KeystoneJS: Relationships in Admin UI not updating
  • Turn off referential integrity in Derby? is it possible?
  • Add sale price programmatically to product variations
  • Unable to use reactive element in my shiny app
  • Net Present Value in Excel for Grouped Recurring CF
  • How do I use LINQ to get all the Items that have a particular SubItem?