[Mathematical Modeling] 2023 Mathematical Modeling National Competition C question complete ideas and code analysis

The code and solution results for the first question of question C have been completed. The amount of data for the first question is a bit large. After programming, the summary data of single product sales was compiled, the single product codes in Appendix 2 were replaced with classification codes, and the vegetables were sorted out. The sales volume of each category changes over time, and a heat map of the Pearson correlation coefficient of these sparse dish categories is made. To download the code and data processing results, see the address at the end of the article.

Subsequent update of the second question and the third question ideas and codes

Automatic pricing and replenishment decision-making for vegetable commodities in the 2023 National Competition Question C

In fresh food supermarkets, the freshness period of general vegetable products is relatively short, and the quality will deteriorate with the increase of sales time. If most varieties are not sold on the same day, they will not be resold the next day. Therefore, supermarkets usually restock every day based on the historical sales and demand of each product.

Since there are many varieties of vegetables sold in supermarkets with different origins, and the purchase and transaction time of vegetables is usually between 3:00 and 4:00 in the morning, merchants must do this without knowing exactly the specific items and purchase prices. Make replenishment decisions for each vegetable category on the day. The pricing of vegetables generally adopts the "cost-plus pricing" method. Supermarkets usually offer discounts for products that have been damaged during transportation and have deteriorated in quality. Reliable market demand analysis is particularly important for replenishment decisions and pricing decisions. From the demand side, there is often a certain correlation between the sales volume of vegetable commodities and time; from the supply side, the supply variety of vegetables is relatively abundant from April to October, and the restrictions on the sales space of supermarkets make reasonable sales Combination becomes extremely important.

Attachment 1 gives the product information of six vegetable categories distributed by a certain supermarket; Attachments 2 and 3 respectively give the sales details and sales of each commodity in the supermarket from July 1, 2020 to June 30, 2023. Relevant data on wholesale prices; Appendix 4 gives the recent loss rate data of each commodity. Please establish a mathematical model based on the attachment and actual situation to solve the following problems:

Question 1: There may be certain correlations between different categories or single products of vegetable commodities. Please analyze the distribution patterns and mutual relationships of sales volume of various vegetable categories and single products.

To analyze the distribution patterns and interrelationships of vegetable categories and single product sales, you can first use the detailed sales data in the attachment for statistics and analysis. Here are some steps and methods:

1. Distribution of sales volume: For each vegetable category and single product, calculate their sales volume on different dates, and then draw a time series diagram of sales volume.

2. Correlation of sales volume: *The correlation of sales volume between different vegetable categories or single products can be calculated. Use the correlation coefficient to measure the linear relationship between them. If the correlation coefficient is close to 1 or -1, it means there is a strong positive or negative correlation between them.

3. Distribution statistics of sales volume: For each vegetable category or single product, calculate its sales statistics, such as average sales volume, maximum sales volume, minimum sales volume, standard deviation of sales volume, etc.

4. Seasonal analysis of sales volume: Use seasonal analysis methods, such as seasonal decomposition or periodic analysis, to determine seasonal patterns in sales volume.

5. Sales volume trend analysis: Use time series analysis methods, such as moving average method or exponential smoothing method, to identify sales volume trends.

6. Factors affecting sales: Consider factors that may affect sales, such as promotional activities, weather changes, holidays, etc. point

Through the above analysis, conclusions can be drawn about the distribution patterns and interrelationships of different vegetable categories and single product sales.

Part of the code for question C in the national competition is as follows (see the address at the end of the article for the complete code):

% 初始化一个向量来存储每个分类编码的销量总和
totalSales = zeros(size(uniqueCodes));

% 遍历每个唯一的分类编码并计算销量总和
for i = 1:length(uniqueCodes)
    code = uniqueCodes(i);
    totalSales(i) = sum(data(data(:, 1) == code, 2));
end
% 打印结果
result = [uniqueCodes, totalSales];
% 对 result 最后得到的结果按分类编码进行排序
result = sortrows(result, 1);
% 存储文件
writematrix(result, "(原始)品类销售量数据汇总.xlsx");

 
 
(完整代码见文末地址)
% 读取附件1中的单品编码和分类编码的对应关系
file1 = '附件1调整后数据.xlsx'; % 文件名
data1 = readtable(file1); % 读取数据

% 读取附件2中的数据
file2 = '附件2调整后数据.xlsx'; % 文件名
data2 = readtable(file2); % 读取数据

sortCode1 = data1.sort_code; % 分类编码列名为 "分类编码"

% 提取附件2的数据中的单品编码
singleCode2 = data2.single_code; % 单品编码列名为 "单品编码"

% 使用单品编码1和分类编码1的对应关系来替换单品编码2
for i = 1:length(singleCode2)
    index = find(strcmp(singleCode1, singleCode2{i}));
    if ~isempty(index)
        data2.sort_code(i) = sortCode1(index(1)); % 假设每个单品编码只对应一个分类编码
end

% 将修改后的数据保存到新的文件中(可选)
newFile = 'problem1_2修改后数据.xlsx';
writetable(data2, newFile);

2023 National Undergraduate Mathematical Modeling National Competition Question C Question 2: Considering that supermarkets make replenishment plans in units of categories, please analyze the relationship between the total sales of each vegetable category and cost-plus pricing, and give the next week for each vegetable category The total daily replenishment volume and pricing strategy of (July 1-7, 2023) have maximized the profits of supermarkets.

To analyze the relationship between the total sales of each vegetable category and cost-plus pricing, and determine the total daily replenishment and pricing strategy for the next week to maximize the revenue of the supermarket, the following steps are required:

Step 1: Calculate the relationship between total sales volume and cost-plus pricing

  • 1. For each vegetable category, obtain historical sales data (from July 1, 2020 to June 30, 2023) from Appendix 2.

  • 2. Calculate the total sales volume of each category, which can be summarized by month or quarter to observe sales trends.

  • 3. Calculate the total cost of each category, including purchase cost and operating cost (such as transportation cost, storage cost, etc.).

  • 4. Calculate the gross profit for each category (total sales minus total costs) based on costs and total sales.

Step 2: Develop the total daily replenishment volume and pricing strategy for the next week

1. For the coming week (July 1-7, 2023), consider the following factors:

  • - Historical sales trends, including seasonal and intra-week fluctuations.

  • - Stock levels of various vegetable categories.

  • - Supplier availability and price fluctuations.

  • - Sales targets and profit targets of supermarkets.

2. Develop the total daily replenishment volume for each category, which can be determined based on historical sales data and sales forecasts. Make sure you have enough inventory to meet demand, but avoid excess inventory waste.

3. Formulate the pricing strategy for each category, generally using the cost-plus pricing method. Consider the category's gross margin, market demand, competition and customer price sensitivity. Pricing strategies should maximize gross profit.

4. Monitor sales data and inventory levels regularly and make adjustments as necessary to adapt to market changes.

The specific situation of each category may be different, so replenishment and pricing strategies need to be developed based on the characteristics and historical data of each category. In addition, profit maximization not only depends on sales and pricing strategies, but is also affected by factors such as cost management, inventory control, and market competition, so multiple factors need to be considered to make decisions. It is recommended to use optimization algorithms or mathematical programming methods to find optimal replenishment and pricing strategies.

Question 3: Due to the limited sales space of vegetable products, the supermarket hopes to further develop a replenishment plan for single products, requiring the total number of single products available for sale to be controlled to 27-33, and the order quantity of each single product must meet the minimum display quantity of 2.5 kg. Require. Based on the varieties available for sale from June 24 to June 30, 2023, the single product replenishment volume and pricing strategy for July 1 are given, so as to maximize the profits of supermarkets while trying to meet the market demand for various types of vegetable commodities.

To formulate a single product replenishment plan to control the total number of available single products between 27 and 33, meet the minimum display quantity requirement (2.5 kg), and maximize the revenue of the supermarket, the following steps can be taken:

Step one: Determine the items available for sale

1. List all available items for sale from June 24 to 30, 2023.

Step 2: Build a mathematical model

1. Define the following parameters for each sellable item:

- Q_i: Replenishment quantity of item $i$ (kg)

- P_i: Pricing strategy of single product $i$ (cost markup expressed as a percentage, for example, if the cost is 10 yuan and the pricing strategy is 20%, the selling price is 12 yuan)

- C_i: Purchase cost of single product $i$ (yuan/kg)

- D_i: Sales demand of single product $i$ (kg)

- S_i: Minimum display quantity of single product $i$ (2.5 kg)

2. Define the objective function: the total revenue of the supermarket can be expressed as the sum of the gross profits of all single products, that is

3. Constraints:

- Constraints on the total number of items available for sale:

- Non-negative constraints on single product replenishment quantity:

- The single product demand satisfies the constraints:

- The minimum display quantity satisfies the constraints:

Step 3: Solve the mathematical model

Use linear programming or other optimization algorithms to solve the above mathematical model to find the optimal single product replenishment quantity and pricing strategy to maximize the total revenue of the supermarket. This will provide a July 1 single-item replenishment plan.

Question 4: In order to better make replenishment and pricing decisions for vegetable commodities, what other relevant data do supermarkets need to collect? How can these data help solve the above problems? Please give your opinions and reasons. For ideas and code downloads, see the address at the end of the article

Appendix 1 Commodity information of 6 vegetable categories Appendix 2 Sales flow details Appendix 3 Wholesale price of vegetable commodities Appendix 4 Recent loss rate of vegetable commodities source of supply.

(2) The attrition rate in Appendix 4 reflects the recent attrition of commodities and is calculated from the data of the recent stocktaking cycle.

2023 Mathematical Modeling National Competition C Question Code and Idea Download Address: C Question Code and Idea Analysis

Guess you like

Origin blog.csdn.net/qq_45857113/article/details/132760528