Skip to content

Latest commit

 

History

History
102 lines (76 loc) · 6.16 KB

Bundle.md

File metadata and controls

102 lines (76 loc) · 6.16 KB

Auction bundles

Table of contents

  1. Generating special depot location
  2. Bundles
  3. Bidding process
  4. Distributing bundles

Generating special depot location

From a certain depot location of a carrier, all depot locations of other carrier within a certain radius is considered as a set of depot locations. A special depot location is generated by getting the mean value of all element in a set of depot locations. Higher tier of special depot location is generated by summing all special depot locations within a certain radius and getting the mean value of such set of special depot locations. Special-depots-generating function is looped until the number of special depot locations is narrowed down under a certain threshold. Setting the maximum radius (to 80) helps to narrow down the number of depot locations faster. Whereas the minimum radius (to 10) helps to form bundles more fitting to each carrier depot location.

Bundles

A bundle is a list of transport request. A bundle has fixed size and contains only transport requests which make profit to a special depot location. The number of transport requests in a bundle has to be equal or smaller than the size of bundle (currently set to 5). A bundle that contains only transport requests that are elements in another bundle, in other words, a bundle that is a subset of another bundle, will be deleted. New bundle will then be generated based on another special depot location.

Example 1: If bundle A = {R1, R2, R3} and bundle B = {R2, R4, R5}, then both bundles are retained.

Example 2: If bundle A = {R1, R2} and bundle B = {R1, R2, R4, R5}, then bundle A is deleted, only bundle B is retained.

Note: Use containsAll() method to form all bundle into a nested list of transport request.

Generating bundles

All requests within radius (initially set to 20) from a special depot location will be considered. Any of them that make profit to that special depot location are formed into a bundle. The number of transport requests in a bundle is set from 3 to 5 requests. If the minimum number of request in a bundle is not reached, the radius will be increased until it reaches its limit (=40). Transport requests that don't belong to any bundles are auctioned off as single request.

Profit calculation

The direct route of a transport request is defined as the route from pickup location straight to deliver location without visiting any other locations. The profit considered when forming bundles is the difference of the price per km multiplied with the length of the direct route and the cost that a carrier has to pay for travelling on the actual route based on the generated tour. The base rate to reach the pickup point and loading/unloading cost are excluded from the calculation as they are irrelevant to the bundle forming process. In particular, following requirements must be fulfilled when forming bundles:

  • All requests within a bundle have to make a positive profit.
  • The total revenue of a bundle based on a special depot location has to be positive, since the total revenue takes the total tour length into account

Bidding process

Not all transport requests within a bundle could bring profit to each carrier. In order to help carriers to maximize their profit while bidding for bundles, as long as the average profit of all requests within a bundle is higher than the value set in Min. profit to bid by a carrier, this bundle is recommended for that carrier to bid. Automatically, carriers will always place their highest possible bid on such bundle, i.e., the difference of the profit and the value of Min. profit to bid.

Example:
Let bundle A = {R1, R2, R3, R4}.
Carrier B set its Min. profit to bid to 30.
Profit gain of R1 for carrier B is 100, R2 is 80, R3 is 50, and R4 is -10.
The average profit that carrier B will attain after including all requests of bundle A in its tour is 55.
Carrier B will automatically bid on bundle A.

In the above example, carrier B will bid 25 for bundle A.

Distributing bundles

All bundles are sold at the same time. The highest bid price (winning price) on a bundle is distributed equally over all requests in that bundle.

If two or more carriers have won two or more bundles that contain some common requests, then only bundles of carrier paying the most are sold, the rest are deformed. The unsold requests will be auctioned off individually in the next iterations.

Example 1: Bundles A and B have some common requests. Carrier 1 has won on bidding bundles A and has to pay 40 in total. Carrier 2 has won bundle B and has to pay 20 in total. Then bundle A is sold to carrier 1, bundle B will be deformed, because the total pay price of carrier 1 is higher.

Example 2: Bundles A and B have common requests, bundles B and C have common requests, and these bundles are respectively won by carrier 1 (payment: 20), carrier 2 (payment: 80) and carrier 3 (payment: 40), then bundle B will be sold to carrier 2, bundle A and C will be deformed.

A smart calculator is implemented to compute which bundles will be sold to maximize the profit for all sellers.

If a carrier has won 2 or more bundles that have some common transport requests, the payment of the second bundle (and other bundles) will be deducted based on the number of common transport request(s).

Example: Carrier A has won bundle B and C which has N requests. These two bundles have 2 common transport requests. Carrier A then have to pay price b for bundle B and price c - cN * 2 for bundle C. Prices b and c are the 2nd highest bid price on each bundle and b > c.

Note: All requests in winning bundles of a carrier are stored as HashMap of winning requests and the prices winners have to pay. Price of a request is the 2nd highest bid of the bundle containing the request divided by the number of requests within that bundle.