| 
						 | 
					@ -926,11 +926,11 @@ iiabmdb|schema||iiabm_user|localhost|UPDATE|G</Grants>
 | 
				
			||||||
    </collation>
 | 
					    </collation>
 | 
				
			||||||
    <schema id="288" parent="1" name="iiabmdb">
 | 
					    <schema id="288" parent="1" name="iiabmdb">
 | 
				
			||||||
      <Current>1</Current>
 | 
					      <Current>1</Current>
 | 
				
			||||||
      <LastIntrospectionLocalTimestamp>2025-02-22.02:31:45</LastIntrospectionLocalTimestamp>
 | 
					      <LastIntrospectionLocalTimestamp>2025-02-22.13:47:26</LastIntrospectionLocalTimestamp>
 | 
				
			||||||
      <CollationName>utf8mb4_0900_ai_ci</CollationName>
 | 
					      <CollationName>utf8mb4_0900_ai_ci</CollationName>
 | 
				
			||||||
    </schema>
 | 
					    </schema>
 | 
				
			||||||
    <schema id="289" parent="1" name="information_schema">
 | 
					    <schema id="289" parent="1" name="information_schema">
 | 
				
			||||||
      <LastIntrospectionLocalTimestamp>2025-02-22.02:31:45</LastIntrospectionLocalTimestamp>
 | 
					      <LastIntrospectionLocalTimestamp>2025-02-22.13:47:27</LastIntrospectionLocalTimestamp>
 | 
				
			||||||
      <CollationName>utf8mb3_general_ci</CollationName>
 | 
					      <CollationName>utf8mb3_general_ci</CollationName>
 | 
				
			||||||
    </schema>
 | 
					    </schema>
 | 
				
			||||||
    <schema id="290" parent="1" name="performance_schema">
 | 
					    <schema id="290" parent="1" name="performance_schema">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,6 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<project version="4">
 | 
				
			||||||
 | 
					  <component name="DeveloperToolsToolWindowSettingsV1" lastSelectedContentNodeId="base64-encoder-decoder">
 | 
				
			||||||
 | 
					    <developerToolsConfigurations />
 | 
				
			||||||
 | 
					  </component>
 | 
				
			||||||
 | 
					</project>
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,6 @@ from mesa import Model
 | 
				
			||||||
from typing import TYPE_CHECKING
 | 
					from typing import TYPE_CHECKING
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from my_model import MyModel
 | 
					from my_model import MyModel
 | 
				
			||||||
from 查看进度 import visualize_progress
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if TYPE_CHECKING:
 | 
					if TYPE_CHECKING:
 | 
				
			||||||
    from controller_db import ControllerDB
 | 
					    from controller_db import ControllerDB
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1 +1 @@
 | 
				
			||||||
db_name_prefix: with_exp
 | 
					db_name_prefix: without_exp
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,5 +8,5 @@ test:  # only for test scenarios
 | 
				
			||||||
  n_iter: 100
 | 
					  n_iter: 100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
not_test:  # normal scenarios
 | 
					not_test:  # normal scenarios
 | 
				
			||||||
  n_sample: 10
 | 
					  n_sample: 50
 | 
				
			||||||
  n_iter: 50
 | 
					  n_iter: 100
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
		 After Width: | Height: | Size: 263 KiB  | 
| 
		 After Width: | Height: | Size: 267 KiB  | 
							
								
								
									
										7
									
								
								main.py
								
								
								
								
							
							
						
						| 
						 | 
					@ -10,7 +10,6 @@ from computation import Computation
 | 
				
			||||||
from sqlalchemy.orm import close_all_sessions
 | 
					from sqlalchemy.orm import close_all_sessions
 | 
				
			||||||
import yaml
 | 
					import yaml
 | 
				
			||||||
from controller_db import ControllerDB
 | 
					from controller_db import ControllerDB
 | 
				
			||||||
from 查看进度 import visualize_progress
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def controll_db_and_process(exp_argument, reset_sample_argument, reset_db_argument):
 | 
					def controll_db_and_process(exp_argument, reset_sample_argument, reset_db_argument):
 | 
				
			||||||
| 
						 | 
					@ -36,10 +35,8 @@ def do_process(target: object, controller_db: ControllerDB, ):
 | 
				
			||||||
        i.join()
 | 
					        i.join()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # 所有子进程完成后刷新最终进度
 | 
					    # 所有子进程完成后刷新最终进度
 | 
				
			||||||
    visualize_progress()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # 显示最终进度后关闭图表
 | 
					    # 显示最终进度后关闭图表
 | 
				
			||||||
    plt.show()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
def do_computation(c_db):
 | 
					def do_computation(c_db):
 | 
				
			||||||
    exp = Computation(c_db)
 | 
					    exp = Computation(c_db)
 | 
				
			||||||
| 
						 | 
					@ -54,10 +51,10 @@ def do_computation(c_db):
 | 
				
			||||||
if __name__ == '__main__':
 | 
					if __name__ == '__main__':
 | 
				
			||||||
    # 输入参数
 | 
					    # 输入参数
 | 
				
			||||||
    parser = argparse.ArgumentParser(description='setting')
 | 
					    parser = argparse.ArgumentParser(description='setting')
 | 
				
			||||||
    parser.add_argument('--exp', type=str, default='with_exp')
 | 
					    parser.add_argument('--exp', type=str, default='without_exp')
 | 
				
			||||||
    parser.add_argument('--job', type=int, default='4')
 | 
					    parser.add_argument('--job', type=int, default='4')
 | 
				
			||||||
    parser.add_argument('--reset_sample', type=int, default='0')
 | 
					    parser.add_argument('--reset_sample', type=int, default='0')
 | 
				
			||||||
    parser.add_argument('--reset_db', type=bool, default=False)
 | 
					    parser.add_argument('--reset_db', type=bool, default=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    args = parser.parse_args()
 | 
					    args = parser.parse_args()
 | 
				
			||||||
    # 几核参与进程
 | 
					    # 几核参与进程
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -527,7 +527,6 @@ class MyModel(Model):
 | 
				
			||||||
    def resource_integration(self):
 | 
					    def resource_integration(self):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        整合企业资源,包括材料、设备和产品数据。
 | 
					        整合企业资源,包括材料、设备和产品数据。
 | 
				
			||||||
 | 
					 | 
				
			||||||
        功能:
 | 
					        功能:
 | 
				
			||||||
        - 加载并处理企业的材料、设备和产品数据。
 | 
					        - 加载并处理企业的材料、设备和产品数据。
 | 
				
			||||||
        - 合并设备数据与设备残值数据。
 | 
					        - 合并设备数据与设备残值数据。
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,37 @@
 | 
				
			||||||
 | 
					idx_scenario,n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,remove_t,netw_prf_n,mean_count_firm_prod,mean_count_firm,mean_count_prod,mean_max_ts_firm_prod,mean_max_ts_firm,mean_max_ts_prod,mean_n_remove_firm_prod,mean_n_all_prod_remove_firm,mean_end_ts,
 | 
				
			||||||
 | 
					0,7,1,1,uniform,5.0000,0.3000,3,3,59.6916,15.7589,13.3347,1.5063,1.5032,1.3842,12.3074,1.5379,2.0400
 | 
				
			||||||
 | 
					1,5,1,1,uniform,10.0000,0.5000,5,2,61.8937,17.1126,13.8095,1.7284,1.7263,1.6042,22.7779,2.9611,3.7432
 | 
				
			||||||
 | 
					2,3,1,1,uniform,15.0000,0.7000,7,1,63.9568,18.2253,14.2779,1.8263,1.8221,1.7347,30.9263,3.7842,5.6253
 | 
				
			||||||
 | 
					3,7,1,1,uniform,5.0000,0.3000,3,2,59.5811,15.7474,13.3168,1.4958,1.4937,1.3884,12.8358,1.4621,2.0221
 | 
				
			||||||
 | 
					4,5,1,1,uniform,10.0000,0.5000,5,1,61.8200,17.0116,13.8053,1.7095,1.7084,1.6032,22.5474,2.9579,3.6811
 | 
				
			||||||
 | 
					5,3,1,1,uniform,15.0000,0.7000,7,3,63.8821,18.2547,14.2432,1.8421,1.8305,1.7295,30.9474,3.7411,5.6632
 | 
				
			||||||
 | 
					6,7,1,1,normal,5.0000,0.5000,7,3,59.9116,15.7516,13.3316,1.4905,1.4884,1.3674,12.2463,1.3326,3.1600
 | 
				
			||||||
 | 
					7,5,1,1,normal,10.0000,0.7000,3,2,61.3095,16.8326,13.7716,1.7011,1.7011,1.6011,22.4779,2.9642,2.4916
 | 
				
			||||||
 | 
					8,3,1,1,normal,15.0000,0.3000,5,1,63.6568,18.1316,14.2358,1.8253,1.8232,1.7242,31.1253,3.7400,4.3474
 | 
				
			||||||
 | 
					9,7,1,0,uniform,5.0000,0.7000,5,3,59.7158,15.6811,13.3000,1.4600,1.4568,1.3537,12.4063,1.3400,2.5316
 | 
				
			||||||
 | 
					10,5,1,0,uniform,10.0000,0.3000,7,2,63.0063,17.6695,14.0432,1.8063,1.8053,1.6747,22.6916,3.0042,5.1126
 | 
				
			||||||
 | 
					11,3,1,0,uniform,15.0000,0.5000,3,1,63.6779,18.3842,14.3547,1.8621,1.8600,1.7621,31.3663,4.0253,2.9632
 | 
				
			||||||
 | 
					12,7,1,0,normal,10.0000,0.7000,3,1,60.6295,16.3884,13.5811,1.6179,1.6147,1.5147,22.5221,2.7800,2.3495
 | 
				
			||||||
 | 
					13,5,1,0,normal,15.0000,0.3000,5,3,63.3484,18.0042,14.2074,1.8316,1.8263,1.7232,30.6379,3.7747,4.2979
 | 
				
			||||||
 | 
					14,3,1,0,normal,5.0000,0.5000,7,2,64.0737,18.3684,14.3000,1.8505,1.8484,1.7589,11.4789,1.1663,4.1400
 | 
				
			||||||
 | 
					15,7,1,0,normal,10.0000,0.7000,5,3,61.0337,16.5684,13.6053,1.6358,1.6347,1.5074,22.7474,2.8937,3.5147
 | 
				
			||||||
 | 
					16,5,1,0,normal,15.0000,0.3000,7,2,63.4747,18.0568,14.1989,1.8347,1.8305,1.7263,30.4063,3.7989,5.7295
 | 
				
			||||||
 | 
					17,3,1,0,normal,5.0000,0.5000,3,1,63.7158,18.2863,14.2958,1.8547,1.8537,1.7579,14.6568,2.1432,2.8368
 | 
				
			||||||
 | 
					18,7,0,1,normal,10.0000,0.3000,7,1,61.2326,16.6442,13.6789,1.6705,1.6684,1.5495,22.5453,2.8379,4.7474
 | 
				
			||||||
 | 
					19,5,0,1,normal,15.0000,0.5000,3,3,62.3863,17.4684,13.9905,1.7874,1.7853,1.6705,31.1558,3.8189,2.7926
 | 
				
			||||||
 | 
					20,3,0,1,normal,5.0000,0.7000,5,2,62.8305,17.6074,14.0811,1.7705,1.7695,1.6768,11.7621,1.2474,3.2684
 | 
				
			||||||
 | 
					21,7,0,1,normal,10.0000,0.5000,7,1,61.1832,16.5389,13.6874,1.6505,1.6484,1.5337,22.8484,2.8147,4.7326
 | 
				
			||||||
 | 
					22,5,0,1,normal,15.0000,0.7000,3,3,62.3305,17.5337,14.0011,1.7768,1.7747,1.6495,30.6705,3.7832,2.7316
 | 
				
			||||||
 | 
					23,3,0,1,normal,5.0000,0.3000,5,2,62.8821,17.6916,14.0905,1.7821,1.7821,1.6895,12.2158,1.3442,3.3484
 | 
				
			||||||
 | 
					24,7,0,1,uniform,15.0000,0.5000,3,2,62.2463,17.4084,13.9789,1.7979,1.7958,1.6674,30.6842,3.7126,2.7589
 | 
				
			||||||
 | 
					25,5,0,1,uniform,5.0000,0.7000,5,1,60.9453,16.4442,13.6316,1.6274,1.6263,1.5032,12.2347,1.2663,2.7368
 | 
				
			||||||
 | 
					26,3,0,1,uniform,10.0000,0.3000,7,3,63.3400,17.8968,14.1147,1.8084,1.8074,1.6937,22.7768,3.0442,5.2442
 | 
				
			||||||
 | 
					27,7,0,0,normal,15.0000,0.5000,5,2,62.6505,17.5074,14.0032,1.7811,1.7800,1.6758,30.0211,3.6116,4.1263
 | 
				
			||||||
 | 
					28,5,0,0,normal,5.0000,0.7000,7,1,60.9200,16.5126,13.6168,1.6368,1.6358,1.5168,11.9432,1.2495,3.3305
 | 
				
			||||||
 | 
					29,3,0,0,normal,10.0000,0.3000,3,3,63.9074,18.4432,14.3916,1.8811,1.8779,1.7789,25.4905,3.4789,3.0295
 | 
				
			||||||
 | 
					30,7,0,0,uniform,15.0000,0.7000,7,2,62.2442,17.2747,13.9400,1.7400,1.7358,1.6253,30.5084,3.6589,5.4421
 | 
				
			||||||
 | 
					31,5,0,0,uniform,5.0000,0.3000,3,1,61.9147,17.2211,13.9347,1.7558,1.7526,1.6453,12.8168,1.6895,2.4516
 | 
				
			||||||
 | 
					32,3,0,0,uniform,10.0000,0.5000,5,3,64.1074,18.3579,14.3558,1.8579,1.8568,1.7505,22.2800,3.0684,4.0642
 | 
				
			||||||
 | 
					33,7,0,0,uniform,15.0000,0.3000,5,1,62.8737,17.5600,14.0642,1.7895,1.7874,1.6684,30.5453,3.6695,4.2147
 | 
				
			||||||
 | 
					34,5,0,0,uniform,5.0000,0.5000,7,3,61.6337,16.9042,13.7632,1.7032,1.7011,1.5716,12.0011,1.2263,3.5221
 | 
				
			||||||
 | 
					35,3,0,0,uniform,10.0000,0.7000,3,2,62.9663,17.9737,14.2221,1.8221,1.8211,1.7211,22.6979,3.1600,2.7389
 | 
				
			||||||
		
		
			
  | 
							
								
								
									
										159322
									
								
								output_result/risk/count.csv
								
								
								
								
							
							
						
						| 
		 Before Width: | Height: | Size: 7.1 MiB After Width: | Height: | Size: 1.1 MiB  | 
| 
		 Before Width: | Height: | Size: 5.2 MiB  | 
| 
		 Before Width: | Height: | Size: 7.5 MiB  | 
| 
		 Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 2.6 MiB  | 
| 
		 Before Width: | Height: | Size: 1.7 MiB  | 
| 
		 Before Width: | Height: | Size: 1.8 MiB  | 
| 
						 | 
					@ -1,164 +1,175 @@
 | 
				
			||||||
id_firm,count
 | 
					id_firm,count
 | 
				
			||||||
70634828,5066
 | 
					653528340,4007
 | 
				
			||||||
3147511625,5066
 | 
					2348941764,3957
 | 
				
			||||||
653528340,5052
 | 
					3215814536,3831
 | 
				
			||||||
3103797386,5046
 | 
					888395016,3750
 | 
				
			||||||
888395016,5046
 | 
					2354145351,3619
 | 
				
			||||||
301209792,5046
 | 
					3147511625,3346
 | 
				
			||||||
2327031723,5042
 | 
					3048263744,3326
 | 
				
			||||||
2317245827,5036
 | 
					2317245827,3230
 | 
				
			||||||
631449822,5032
 | 
					631449822,3149
 | 
				
			||||||
2348941764,5026
 | 
					3103797386,3123
 | 
				
			||||||
194210021,5022
 | 
					194210021,3077
 | 
				
			||||||
191912252,5012
 | 
					2327031723,3004
 | 
				
			||||||
3048263744,5002
 | 
					301209792,2997
 | 
				
			||||||
3215814536,4996
 | 
					191912252,2804
 | 
				
			||||||
2354145351,4992
 | 
					70634828,2464
 | 
				
			||||||
2312490120,1910
 | 
					2321109759,1165
 | 
				
			||||||
503176785,1850
 | 
					3299144127,1130
 | 
				
			||||||
25685135,1566
 | 
					3445928818,1120
 | 
				
			||||||
2944892892,1556
 | 
					2312490120,1077
 | 
				
			||||||
2624175,1546
 | 
					503176785,1003
 | 
				
			||||||
3269039233,1546
 | 
					930767828,467
 | 
				
			||||||
3445928818,1476
 | 
					3407754893,451
 | 
				
			||||||
2321109759,1466
 | 
					2944892892,355
 | 
				
			||||||
3299144127,1456
 | 
					3269039233,354
 | 
				
			||||||
930767828,726
 | 
					750610681,353
 | 
				
			||||||
3407754893,716
 | 
					25685135,351
 | 
				
			||||||
571058167,350
 | 
					343012684,342
 | 
				
			||||||
343012684,350
 | 
					3069206426,339
 | 
				
			||||||
750610681,350
 | 
					448033045,329
 | 
				
			||||||
2317841563,350
 | 
					2624175,328
 | 
				
			||||||
888356483,350
 | 
					2320475044,321
 | 
				
			||||||
2320475044,350
 | 
					413274977,314
 | 
				
			||||||
43407343,350
 | 
					3111033905,310
 | 
				
			||||||
152008168,350
 | 
					2317841563,310
 | 
				
			||||||
413274977,350
 | 
					43407343,304
 | 
				
			||||||
3111033905,350
 | 
					571058167,302
 | 
				
			||||||
3069206426,350
 | 
					607512171,286
 | 
				
			||||||
25945288,350
 | 
					152008168,272
 | 
				
			||||||
607512171,340
 | 
					888356483,250
 | 
				
			||||||
448033045,340
 | 
					25945288,222
 | 
				
			||||||
1452048,20
 | 
					1452048,20
 | 
				
			||||||
2311838590,20
 | 
					2311838590,20
 | 
				
			||||||
2424229017,20
 | 
					 | 
				
			||||||
3373311444,20
 | 
					3373311444,20
 | 
				
			||||||
11807506,20
 | 
					11807506,20
 | 
				
			||||||
400488703,10
 | 
					2424229017,18
 | 
				
			||||||
420984285,10
 | 
					 | 
				
			||||||
400692942,10
 | 
					 | 
				
			||||||
4208851809,10
 | 
					4208851809,10
 | 
				
			||||||
3445244192,10
 | 
					3271705843,10
 | 
				
			||||||
888478182,10
 | 
					3269940677,10
 | 
				
			||||||
 | 
					420984285,10
 | 
				
			||||||
 | 
					400488703,10
 | 
				
			||||||
 | 
					400692942,10
 | 
				
			||||||
354897041,10
 | 
					354897041,10
 | 
				
			||||||
9,10
 | 
					3462551351,10
 | 
				
			||||||
4518234098,10
 | 
					3288105727,10
 | 
				
			||||||
3433628561,10
 | 
					 | 
				
			||||||
3398677646,10
 | 
					 | 
				
			||||||
3395900897,10
 | 
					 | 
				
			||||||
3384021594,10
 | 
					 | 
				
			||||||
3372913783,10
 | 
					 | 
				
			||||||
3344297292,10
 | 
					 | 
				
			||||||
3312358902,10
 | 
					3312358902,10
 | 
				
			||||||
9746245,10
 | 
					3344297292,10
 | 
				
			||||||
887840774,10
 | 
					3372913783,10
 | 
				
			||||||
5007015990,10
 | 
					3384021594,10
 | 
				
			||||||
 | 
					3445244192,10
 | 
				
			||||||
 | 
					3433628561,10
 | 
				
			||||||
 | 
					3395900897,10
 | 
				
			||||||
453289520,10
 | 
					453289520,10
 | 
				
			||||||
593312758,10
 | 
					1033972427,10
 | 
				
			||||||
 | 
					581407487,10
 | 
				
			||||||
 | 
					474279224,10
 | 
				
			||||||
 | 
					857978527,10
 | 
				
			||||||
7299120,10
 | 
					7299120,10
 | 
				
			||||||
7,10
 | 
					737770776,10
 | 
				
			||||||
762985858,10
 | 
					762985858,10
 | 
				
			||||||
 | 
					771821595,10
 | 
				
			||||||
 | 
					80158773,10
 | 
				
			||||||
 | 
					829768,10
 | 
				
			||||||
 | 
					863079,10
 | 
				
			||||||
 | 
					495782506,10
 | 
				
			||||||
 | 
					868012326,10
 | 
				
			||||||
 | 
					872394725,10
 | 
				
			||||||
 | 
					887840774,10
 | 
				
			||||||
 | 
					888478182,10
 | 
				
			||||||
 | 
					9,10
 | 
				
			||||||
 | 
					9746245,10
 | 
				
			||||||
 | 
					71271700,10
 | 
				
			||||||
 | 
					7,10
 | 
				
			||||||
695995052,10
 | 
					695995052,10
 | 
				
			||||||
688155470,10
 | 
					688155470,10
 | 
				
			||||||
654825436,10
 | 
					654825436,10
 | 
				
			||||||
771821595,10
 | 
					 | 
				
			||||||
80158773,10
 | 
					 | 
				
			||||||
644292599,10
 | 
					644292599,10
 | 
				
			||||||
829768,10
 | 
					 | 
				
			||||||
620220747,10
 | 
					620220747,10
 | 
				
			||||||
615763365,10
 | 
					615763365,10
 | 
				
			||||||
594378026,10
 | 
					594378026,10
 | 
				
			||||||
857978527,10
 | 
					593312758,10
 | 
				
			||||||
474279224,10
 | 
					 | 
				
			||||||
591452402,10
 | 
					591452402,10
 | 
				
			||||||
5849940,10
 | 
					5849940,10
 | 
				
			||||||
3271705843,10
 | 
					3226664625,10
 | 
				
			||||||
581407487,10
 | 
					 | 
				
			||||||
561545339,10
 | 
					561545339,10
 | 
				
			||||||
560866402,10
 | 
					560866402,10
 | 
				
			||||||
549184982,10
 | 
					549184982,10
 | 
				
			||||||
863079,10
 | 
					 | 
				
			||||||
5278074,10
 | 
					5278074,10
 | 
				
			||||||
868012326,10
 | 
					 | 
				
			||||||
71271700,10
 | 
					 | 
				
			||||||
495782506,10
 | 
					 | 
				
			||||||
483081978,10
 | 
					 | 
				
			||||||
1033972427,10
 | 
					 | 
				
			||||||
3127420424,10
 | 
					 | 
				
			||||||
3269940677,10
 | 
					 | 
				
			||||||
218633337,10
 | 
					 | 
				
			||||||
2343704209,10
 | 
					 | 
				
			||||||
2341555098,10
 | 
					 | 
				
			||||||
2339684065,10
 | 
					 | 
				
			||||||
2339188563,10
 | 
					 | 
				
			||||||
2337952436,10
 | 
					 | 
				
			||||||
2333843479,10
 | 
					 | 
				
			||||||
2329375731,10
 | 
					 | 
				
			||||||
2327979389,10
 | 
					 | 
				
			||||||
2326478786,10
 | 
					 | 
				
			||||||
2324844174,10
 | 
					 | 
				
			||||||
2324787028,10
 | 
					 | 
				
			||||||
2320102626,10
 | 
					 | 
				
			||||||
2316990095,10
 | 
					 | 
				
			||||||
2310825263,10
 | 
					 | 
				
			||||||
213386023,10
 | 
					 | 
				
			||||||
2352036411,10
 | 
					 | 
				
			||||||
203314437,10
 | 
					 | 
				
			||||||
2010673,10
 | 
					 | 
				
			||||||
1679596339,10
 | 
					 | 
				
			||||||
1606833003,10
 | 
					 | 
				
			||||||
159511306,10
 | 
					 | 
				
			||||||
15613202,10
 | 
					 | 
				
			||||||
1549474227,10
 | 
					 | 
				
			||||||
151606446,10
 | 
					 | 
				
			||||||
145511905,10
 | 
					 | 
				
			||||||
1375606900,10
 | 
					 | 
				
			||||||
1307012237,10
 | 
					 | 
				
			||||||
1217957486,10
 | 
					 | 
				
			||||||
118882692,10
 | 
					 | 
				
			||||||
1128343125,10
 | 
					 | 
				
			||||||
2349656760,10
 | 
					 | 
				
			||||||
24284343,10
 | 
					 | 
				
			||||||
3267688490,10
 | 
					3267688490,10
 | 
				
			||||||
24673506,10
 | 
					 | 
				
			||||||
3226664625,10
 | 
					 | 
				
			||||||
3221190269,10
 | 
					 | 
				
			||||||
3211956484,10
 | 
					 | 
				
			||||||
3203777710,10
 | 
					 | 
				
			||||||
3195502499,10
 | 
					 | 
				
			||||||
3188903709,10
 | 
					 | 
				
			||||||
3177507356,10
 | 
					 | 
				
			||||||
3133307899,10
 | 
					 | 
				
			||||||
3122923980,10
 | 
					 | 
				
			||||||
3120341363,10
 | 
					 | 
				
			||||||
3113895788,10
 | 
					 | 
				
			||||||
3072715478,10
 | 
					 | 
				
			||||||
3070859372,10
 | 
					 | 
				
			||||||
3047163873,10
 | 
					 | 
				
			||||||
3045721313,10
 | 
					 | 
				
			||||||
3026382513,10
 | 
					 | 
				
			||||||
3025036704,10
 | 
					 | 
				
			||||||
29954548,10
 | 
					 | 
				
			||||||
2820140348,10
 | 
					 | 
				
			||||||
278221281,10
 | 
					 | 
				
			||||||
27731896,10
 | 
					 | 
				
			||||||
2728939,10
 | 
					 | 
				
			||||||
271860868,10
 | 
					 | 
				
			||||||
27075840,10
 | 
					 | 
				
			||||||
26516263,10
 | 
					 | 
				
			||||||
26162741,10
 | 
					 | 
				
			||||||
2545430247,10
 | 
					 | 
				
			||||||
251189644,10
 | 
					 | 
				
			||||||
25036634,10
 | 
					 | 
				
			||||||
996174506,10
 | 
					996174506,10
 | 
				
			||||||
11164476478,6
 | 
					3221190269,10
 | 
				
			||||||
 | 
					2311581270,10
 | 
				
			||||||
 | 
					2316990095,10
 | 
				
			||||||
 | 
					2320102626,10
 | 
				
			||||||
 | 
					2324787028,10
 | 
				
			||||||
 | 
					2324844174,10
 | 
				
			||||||
 | 
					2326478786,10
 | 
				
			||||||
 | 
					2327979389,10
 | 
				
			||||||
 | 
					2329375731,10
 | 
				
			||||||
 | 
					2333843479,10
 | 
				
			||||||
 | 
					2337952436,10
 | 
				
			||||||
 | 
					2339684065,10
 | 
				
			||||||
 | 
					2341555098,10
 | 
				
			||||||
 | 
					2343704209,10
 | 
				
			||||||
 | 
					2347013470,10
 | 
				
			||||||
 | 
					2350418059,10
 | 
				
			||||||
 | 
					2352036411,10
 | 
				
			||||||
 | 
					2313209417,10
 | 
				
			||||||
 | 
					2310825263,10
 | 
				
			||||||
 | 
					3211956484,10
 | 
				
			||||||
 | 
					218633337,10
 | 
				
			||||||
 | 
					1128343125,10
 | 
				
			||||||
 | 
					118882692,10
 | 
				
			||||||
 | 
					1217957486,10
 | 
				
			||||||
 | 
					1307012237,10
 | 
				
			||||||
 | 
					1375606900,10
 | 
				
			||||||
 | 
					145511905,10
 | 
				
			||||||
 | 
					151606446,10
 | 
				
			||||||
 | 
					1549474227,10
 | 
				
			||||||
 | 
					15613202,10
 | 
				
			||||||
 | 
					159511306,10
 | 
				
			||||||
 | 
					1606833003,10
 | 
				
			||||||
 | 
					1679596339,10
 | 
				
			||||||
 | 
					2010673,10
 | 
				
			||||||
 | 
					203314437,10
 | 
				
			||||||
 | 
					213386023,10
 | 
				
			||||||
 | 
					24284343,10
 | 
				
			||||||
 | 
					24673506,10
 | 
				
			||||||
 | 
					25036634,10
 | 
				
			||||||
 | 
					3120341363,10
 | 
				
			||||||
 | 
					3047163873,10
 | 
				
			||||||
 | 
					3070859372,10
 | 
				
			||||||
 | 
					3072715478,10
 | 
				
			||||||
 | 
					3089095447,10
 | 
				
			||||||
 | 
					3100891962,10
 | 
				
			||||||
 | 
					3113895788,10
 | 
				
			||||||
 | 
					3122923980,10
 | 
				
			||||||
 | 
					251189644,10
 | 
				
			||||||
 | 
					11164476478,10
 | 
				
			||||||
 | 
					3133307899,10
 | 
				
			||||||
 | 
					3177507356,10
 | 
				
			||||||
 | 
					3188352290,10
 | 
				
			||||||
 | 
					3188903709,10
 | 
				
			||||||
 | 
					3195502499,10
 | 
				
			||||||
 | 
					3045721313,10
 | 
				
			||||||
 | 
					3031009366,10
 | 
				
			||||||
 | 
					3026382513,10
 | 
				
			||||||
 | 
					271860868,10
 | 
				
			||||||
 | 
					2545430247,10
 | 
				
			||||||
 | 
					26162741,10
 | 
				
			||||||
 | 
					26516263,10
 | 
				
			||||||
 | 
					3025036704,10
 | 
				
			||||||
 | 
					27075840,10
 | 
				
			||||||
 | 
					2728939,10
 | 
				
			||||||
 | 
					27731896,10
 | 
				
			||||||
 | 
					278221281,10
 | 
				
			||||||
 | 
					2820140348,10
 | 
				
			||||||
 | 
					29954548,10
 | 
				
			||||||
 | 
					3398677646,9
 | 
				
			||||||
 | 
					3127420424,9
 | 
				
			||||||
 | 
					5007015990,8
 | 
				
			||||||
 | 
					3203777710,8
 | 
				
			||||||
 | 
					2339188563,7
 | 
				
			||||||
 | 
					483081978,6
 | 
				
			||||||
 | 
					517717050,6
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		
		
			
  | 
| 
						 | 
					@ -1,359 +1,370 @@
 | 
				
			||||||
id_firm,id_product,count
 | 
					id_firm,id_product,count
 | 
				
			||||||
25685135,99,1566
 | 
					2321109759,95,1155
 | 
				
			||||||
2944892892,99,1556
 | 
					3299144127,95,1138
 | 
				
			||||||
3269039233,99,1546
 | 
					3445928818,95,1123
 | 
				
			||||||
2624175,99,1546
 | 
					930767828,90,468
 | 
				
			||||||
3445928818,95,1476
 | 
					3407754893,90,443
 | 
				
			||||||
2321109759,95,1466
 | 
					653528340,55,434
 | 
				
			||||||
3299144127,95,1456
 | 
					653528340,52,430
 | 
				
			||||||
930767828,90,726
 | 
					2348941764,55,427
 | 
				
			||||||
3407754893,90,716
 | 
					2348941764,52,425
 | 
				
			||||||
194210021,50,646
 | 
					2354145351,52,421
 | 
				
			||||||
3147511625,50,646
 | 
					3215814536,52,421
 | 
				
			||||||
2327031723,50,646
 | 
					888395016,55,420
 | 
				
			||||||
191912252,50,646
 | 
					2354145351,55,419
 | 
				
			||||||
631449822,50,646
 | 
					888395016,52,411
 | 
				
			||||||
653528340,50,636
 | 
					3215814536,55,409
 | 
				
			||||||
2348941764,50,636
 | 
					653528340,54,397
 | 
				
			||||||
2317245827,50,636
 | 
					653528340,53,396
 | 
				
			||||||
3215814536,50,636
 | 
					653528340,50,395
 | 
				
			||||||
888395016,50,636
 | 
					653528340,51,395
 | 
				
			||||||
70634828,50,636
 | 
					750610681,92,389
 | 
				
			||||||
301209792,50,636
 | 
					343012684,92,379
 | 
				
			||||||
2354145351,50,636
 | 
					2348941764,51,379
 | 
				
			||||||
3048263744,50,636
 | 
					3048263744,55,379
 | 
				
			||||||
3103797386,50,636
 | 
					2354145351,53,377
 | 
				
			||||||
2317245827,54,596
 | 
					3147511625,52,374
 | 
				
			||||||
301209792,54,596
 | 
					2354145351,51,372
 | 
				
			||||||
2317245827,51,596
 | 
					888395016,50,371
 | 
				
			||||||
3048263744,54,596
 | 
					888395016,53,371
 | 
				
			||||||
3103797386,51,596
 | 
					3048263744,52,370
 | 
				
			||||||
194210021,54,596
 | 
					888395016,51,369
 | 
				
			||||||
194210021,53,596
 | 
					2348941764,53,369
 | 
				
			||||||
2348941764,51,596
 | 
					2348941764,54,367
 | 
				
			||||||
191912252,54,596
 | 
					3147511625,55,367
 | 
				
			||||||
191912252,53,596
 | 
					2354145351,54,365
 | 
				
			||||||
3215814536,53,596
 | 
					448033045,94,364
 | 
				
			||||||
3215814536,54,596
 | 
					2354145351,50,364
 | 
				
			||||||
2348941764,54,596
 | 
					2348941764,50,361
 | 
				
			||||||
2354145351,53,596
 | 
					3269039233,99,361
 | 
				
			||||||
888395016,53,596
 | 
					888395016,54,358
 | 
				
			||||||
70634828,53,596
 | 
					3215814536,51,355
 | 
				
			||||||
70634828,54,596
 | 
					2944892892,99,354
 | 
				
			||||||
2327031723,54,596
 | 
					2317245827,55,353
 | 
				
			||||||
3147511625,54,596
 | 
					25685135,99,351
 | 
				
			||||||
2327031723,53,596
 | 
					2317245827,52,350
 | 
				
			||||||
653528340,54,596
 | 
					3215814536,54,349
 | 
				
			||||||
653528340,53,596
 | 
					631449822,55,349
 | 
				
			||||||
631449822,54,596
 | 
					3069206426,93,348
 | 
				
			||||||
2327031723,51,586
 | 
					3215814536,50,347
 | 
				
			||||||
2354145351,54,586
 | 
					194210021,52,346
 | 
				
			||||||
301209792,51,586
 | 
					631449822,52,345
 | 
				
			||||||
2317245827,53,586
 | 
					3215814536,53,344
 | 
				
			||||||
301209792,53,586
 | 
					3111033905,93,343
 | 
				
			||||||
653528340,51,586
 | 
					2327031723,52,341
 | 
				
			||||||
3215814536,51,586
 | 
					191912252,55,341
 | 
				
			||||||
3048263744,53,586
 | 
					70634828,52,340
 | 
				
			||||||
888395016,51,586
 | 
					3103797386,55,339
 | 
				
			||||||
3103797386,54,586
 | 
					194210021,55,336
 | 
				
			||||||
3147511625,51,586
 | 
					301209792,52,335
 | 
				
			||||||
3103797386,53,586
 | 
					301209792,55,333
 | 
				
			||||||
3048263744,51,586
 | 
					3103797386,52,332
 | 
				
			||||||
888395016,54,586
 | 
					191912252,52,330
 | 
				
			||||||
194210021,51,586
 | 
					2320475044,94,327
 | 
				
			||||||
2354145351,51,576
 | 
					3147511625,53,322
 | 
				
			||||||
191912252,51,576
 | 
					3048263744,53,319
 | 
				
			||||||
631449822,51,576
 | 
					2327031723,55,318
 | 
				
			||||||
2348941764,53,576
 | 
					2624175,99,318
 | 
				
			||||||
3147511625,53,576
 | 
					3147511625,51,316
 | 
				
			||||||
631449822,53,576
 | 
					3048263744,51,312
 | 
				
			||||||
70634828,51,576
 | 
					3147511625,54,310
 | 
				
			||||||
653528340,52,556
 | 
					2317245827,50,308
 | 
				
			||||||
70634828,52,556
 | 
					3147511625,50,307
 | 
				
			||||||
3147511625,52,556
 | 
					3048263744,50,307
 | 
				
			||||||
888395016,52,556
 | 
					571058167,94,306
 | 
				
			||||||
631449822,52,556
 | 
					2317245827,53,303
 | 
				
			||||||
3103797386,52,546
 | 
					2317841563,91,303
 | 
				
			||||||
301209792,52,546
 | 
					3048263744,54,302
 | 
				
			||||||
2327031723,52,546
 | 
					2317245827,54,298
 | 
				
			||||||
3147511625,55,536
 | 
					631449822,51,297
 | 
				
			||||||
2354145351,52,536
 | 
					194210021,53,297
 | 
				
			||||||
888395016,55,536
 | 
					413274977,91,295
 | 
				
			||||||
2348941764,52,536
 | 
					3103797386,50,291
 | 
				
			||||||
631449822,55,536
 | 
					2317245827,51,291
 | 
				
			||||||
653528340,55,536
 | 
					3103797386,51,290
 | 
				
			||||||
2317245827,52,536
 | 
					43407343,93,289
 | 
				
			||||||
3048263744,52,536
 | 
					70634828,55,289
 | 
				
			||||||
70634828,55,536
 | 
					607512171,91,288
 | 
				
			||||||
191912252,52,536
 | 
					194210021,51,288
 | 
				
			||||||
194210021,52,536
 | 
					3103797386,53,287
 | 
				
			||||||
3103797386,55,526
 | 
					194210021,50,287
 | 
				
			||||||
301209792,55,526
 | 
					194210021,54,286
 | 
				
			||||||
2327031723,55,526
 | 
					631449822,53,285
 | 
				
			||||||
3215814536,52,526
 | 
					653528340,48,285
 | 
				
			||||||
2354145351,55,516
 | 
					152008168,94,283
 | 
				
			||||||
2348941764,55,516
 | 
					653528340,49,283
 | 
				
			||||||
194210021,55,516
 | 
					653528340,46,282
 | 
				
			||||||
3048263744,55,516
 | 
					631449822,50,281
 | 
				
			||||||
2317245827,55,516
 | 
					3103797386,54,281
 | 
				
			||||||
191912252,55,516
 | 
					653528340,45,278
 | 
				
			||||||
3215814536,55,506
 | 
					2327031723,53,277
 | 
				
			||||||
2312490120,39,380
 | 
					653528340,44,276
 | 
				
			||||||
503176785,43,366
 | 
					653528340,47,276
 | 
				
			||||||
2312490120,43,366
 | 
					2327031723,50,275
 | 
				
			||||||
3069206426,93,350
 | 
					631449822,54,273
 | 
				
			||||||
3111033905,93,350
 | 
					191912252,54,272
 | 
				
			||||||
571058167,94,350
 | 
					2327031723,51,270
 | 
				
			||||||
25945288,93,350
 | 
					301209792,54,266
 | 
				
			||||||
43407343,93,350
 | 
					2312490120,41,266
 | 
				
			||||||
343012684,92,350
 | 
					888395016,45,266
 | 
				
			||||||
413274977,91,350
 | 
					2348941764,49,266
 | 
				
			||||||
888356483,91,350
 | 
					191912252,51,264
 | 
				
			||||||
503176785,40,350
 | 
					301209792,53,263
 | 
				
			||||||
2320475044,94,350
 | 
					2348941764,48,262
 | 
				
			||||||
152008168,94,350
 | 
					2348941764,46,262
 | 
				
			||||||
2317841563,91,350
 | 
					2348941764,45,261
 | 
				
			||||||
750610681,92,350
 | 
					301209792,51,261
 | 
				
			||||||
448033045,94,340
 | 
					301209792,50,260
 | 
				
			||||||
607512171,91,340
 | 
					2327031723,54,259
 | 
				
			||||||
2312490120,40,336
 | 
					888395016,49,259
 | 
				
			||||||
2312490120,38,336
 | 
					2348941764,47,257
 | 
				
			||||||
503176785,38,326
 | 
					191912252,50,256
 | 
				
			||||||
503176785,39,316
 | 
					888395016,48,256
 | 
				
			||||||
2348941764,49,260
 | 
					2348941764,44,253
 | 
				
			||||||
2348941764,48,260
 | 
					888395016,46,253
 | 
				
			||||||
3103797386,45,260
 | 
					2354145351,46,252
 | 
				
			||||||
2317245827,44,260
 | 
					70634828,51,252
 | 
				
			||||||
2317245827,45,260
 | 
					888395016,47,251
 | 
				
			||||||
2317245827,46,260
 | 
					2312490120,42,250
 | 
				
			||||||
301209792,49,260
 | 
					191912252,53,248
 | 
				
			||||||
301209792,48,260
 | 
					888395016,44,248
 | 
				
			||||||
3103797386,44,260
 | 
					2354145351,47,247
 | 
				
			||||||
3103797386,48,260
 | 
					2354145351,49,246
 | 
				
			||||||
3103797386,46,260
 | 
					2354145351,48,245
 | 
				
			||||||
888395016,46,260
 | 
					3215814536,49,241
 | 
				
			||||||
3215814536,49,260
 | 
					70634828,54,239
 | 
				
			||||||
3215814536,48,260
 | 
					3215814536,48,238
 | 
				
			||||||
3215814536,47,260
 | 
					888356483,91,236
 | 
				
			||||||
3215814536,46,260
 | 
					3215814536,46,236
 | 
				
			||||||
888395016,49,260
 | 
					70634828,50,232
 | 
				
			||||||
888395016,48,260
 | 
					3215814536,47,232
 | 
				
			||||||
888395016,47,260
 | 
					2354145351,45,231
 | 
				
			||||||
3147511625,49,260
 | 
					2354145351,44,231
 | 
				
			||||||
3103797386,47,260
 | 
					3215814536,44,230
 | 
				
			||||||
3147511625,48,260
 | 
					3215814536,45,230
 | 
				
			||||||
3147511625,47,260
 | 
					3048263744,48,230
 | 
				
			||||||
3147511625,46,260
 | 
					70634828,53,229
 | 
				
			||||||
3147511625,45,260
 | 
					3048263744,47,227
 | 
				
			||||||
3147511625,44,260
 | 
					3048263744,46,221
 | 
				
			||||||
3103797386,49,260
 | 
					3048263744,45,220
 | 
				
			||||||
301209792,46,260
 | 
					3048263744,44,217
 | 
				
			||||||
301209792,47,260
 | 
					194210021,46,217
 | 
				
			||||||
70634828,44,260
 | 
					2317245827,44,217
 | 
				
			||||||
301209792,45,260
 | 
					3048263744,49,216
 | 
				
			||||||
2348941764,44,260
 | 
					3147511625,48,212
 | 
				
			||||||
301209792,44,260
 | 
					3147511625,49,212
 | 
				
			||||||
2317245827,49,260
 | 
					3147511625,45,210
 | 
				
			||||||
70634828,49,260
 | 
					3147511625,44,210
 | 
				
			||||||
70634828,48,260
 | 
					2317245827,46,209
 | 
				
			||||||
70634828,46,260
 | 
					503176785,42,208
 | 
				
			||||||
70634828,47,260
 | 
					503176785,41,208
 | 
				
			||||||
70634828,45,260
 | 
					3147511625,47,206
 | 
				
			||||||
2317245827,47,260
 | 
					194210021,48,206
 | 
				
			||||||
2348941764,45,260
 | 
					3103797386,44,205
 | 
				
			||||||
2348941764,46,260
 | 
					2317245827,47,204
 | 
				
			||||||
2348941764,47,260
 | 
					194210021,44,203
 | 
				
			||||||
2317245827,48,260
 | 
					2317245827,49,203
 | 
				
			||||||
631449822,45,256
 | 
					3147511625,46,202
 | 
				
			||||||
191912252,49,256
 | 
					2317245827,45,201
 | 
				
			||||||
191912252,48,256
 | 
					194210021,45,200
 | 
				
			||||||
191912252,47,256
 | 
					3103797386,49,200
 | 
				
			||||||
191912252,46,256
 | 
					631449822,45,199
 | 
				
			||||||
631449822,48,256
 | 
					194210021,49,197
 | 
				
			||||||
191912252,45,256
 | 
					191912252,49,196
 | 
				
			||||||
631449822,47,256
 | 
					3103797386,46,196
 | 
				
			||||||
631449822,46,256
 | 
					2317245827,48,196
 | 
				
			||||||
2327031723,49,256
 | 
					2327031723,49,195
 | 
				
			||||||
631449822,44,256
 | 
					194210021,47,194
 | 
				
			||||||
2327031723,48,256
 | 
					25945288,93,194
 | 
				
			||||||
2354145351,44,256
 | 
					631449822,49,193
 | 
				
			||||||
2327031723,47,256
 | 
					2327031723,48,192
 | 
				
			||||||
191912252,44,256
 | 
					301209792,46,192
 | 
				
			||||||
2354145351,49,256
 | 
					70634828,49,191
 | 
				
			||||||
2354145351,48,256
 | 
					191912252,46,190
 | 
				
			||||||
2354145351,47,256
 | 
					191912252,44,190
 | 
				
			||||||
2354145351,46,256
 | 
					2327031723,45,190
 | 
				
			||||||
2354145351,45,256
 | 
					3103797386,47,190
 | 
				
			||||||
194210021,44,256
 | 
					631449822,48,189
 | 
				
			||||||
3048263744,45,256
 | 
					3103797386,48,189
 | 
				
			||||||
2327031723,46,256
 | 
					301209792,44,188
 | 
				
			||||||
3048263744,49,256
 | 
					631449822,47,185
 | 
				
			||||||
653528340,44,256
 | 
					301209792,45,185
 | 
				
			||||||
653528340,45,256
 | 
					191912252,48,183
 | 
				
			||||||
653528340,46,256
 | 
					191912252,45,183
 | 
				
			||||||
2312490120,41,256
 | 
					631449822,44,183
 | 
				
			||||||
653528340,47,256
 | 
					2327031723,46,182
 | 
				
			||||||
653528340,48,256
 | 
					503176785,43,182
 | 
				
			||||||
3048263744,44,256
 | 
					3103797386,45,181
 | 
				
			||||||
3048263744,46,256
 | 
					70634828,46,180
 | 
				
			||||||
3048263744,47,256
 | 
					631449822,46,180
 | 
				
			||||||
3048263744,48,256
 | 
					2327031723,44,180
 | 
				
			||||||
653528340,49,256
 | 
					301209792,48,177
 | 
				
			||||||
503176785,41,256
 | 
					2327031723,47,176
 | 
				
			||||||
194210021,49,256
 | 
					191912252,47,174
 | 
				
			||||||
194210021,48,256
 | 
					301209792,49,174
 | 
				
			||||||
2327031723,45,256
 | 
					301209792,47,173
 | 
				
			||||||
194210021,47,256
 | 
					70634828,48,173
 | 
				
			||||||
2327031723,44,256
 | 
					70634828,47,172
 | 
				
			||||||
194210021,46,256
 | 
					70634828,44,165
 | 
				
			||||||
194210021,45,256
 | 
					70634828,45,160
 | 
				
			||||||
631449822,49,256
 | 
					2312490120,40,140
 | 
				
			||||||
888395016,44,250
 | 
					2312490120,39,139
 | 
				
			||||||
888395016,45,250
 | 
					2312490120,38,135
 | 
				
			||||||
3215814536,45,250
 | 
					503176785,39,128
 | 
				
			||||||
3215814536,44,250
 | 
					503176785,38,122
 | 
				
			||||||
503176785,42,236
 | 
					2312490120,43,119
 | 
				
			||||||
2312490120,42,236
 | 
					503176785,40,110
 | 
				
			||||||
549184982,69,10
 | 
					3133307899,23,20
 | 
				
			||||||
474279224,71,10
 | 
					3395900897,73,18
 | 
				
			||||||
4518234098,12,10
 | 
					3221190269,20,17
 | 
				
			||||||
 | 
					3384021594,64,15
 | 
				
			||||||
 | 
					2820140348,62,15
 | 
				
			||||||
 | 
					1375606900,67,15
 | 
				
			||||||
 | 
					3445244192,24,15
 | 
				
			||||||
 | 
					887840774,8,15
 | 
				
			||||||
 | 
					3312358902,59,14
 | 
				
			||||||
 | 
					26516263,8,14
 | 
				
			||||||
 | 
					24284343,35,14
 | 
				
			||||||
 | 
					251189644,23,14
 | 
				
			||||||
 | 
					7,10,14
 | 
				
			||||||
 | 
					26162741,11,14
 | 
				
			||||||
 | 
					400692942,68,13
 | 
				
			||||||
 | 
					354897041,72,13
 | 
				
			||||||
 | 
					996174506,15,13
 | 
				
			||||||
 | 
					3211956484,34,13
 | 
				
			||||||
 | 
					203314437,22,13
 | 
				
			||||||
 | 
					11807506,23,13
 | 
				
			||||||
 | 
					1307012237,68,13
 | 
				
			||||||
 | 
					194210021,7,13
 | 
				
			||||||
 | 
					2010673,64,13
 | 
				
			||||||
 | 
					3373311444,20,13
 | 
				
			||||||
 | 
					688155470,30,13
 | 
				
			||||||
 | 
					2347013470,61,13
 | 
				
			||||||
 | 
					271860868,12,13
 | 
				
			||||||
 | 
					71271700,27,12
 | 
				
			||||||
 | 
					863079,11,12
 | 
				
			||||||
 | 
					420984285,16,12
 | 
				
			||||||
 | 
					644292599,11,12
 | 
				
			||||||
 | 
					9,37,12
 | 
				
			||||||
 | 
					5849940,26,12
 | 
				
			||||||
 | 
					9746245,97,12
 | 
				
			||||||
 | 
					868012326,29,12
 | 
				
			||||||
 | 
					1033972427,61,12
 | 
				
			||||||
 | 
					3373311444,71,12
 | 
				
			||||||
 | 
					3120341363,79,12
 | 
				
			||||||
 | 
					1128343125,63,12
 | 
				
			||||||
 | 
					1217957486,31,12
 | 
				
			||||||
 | 
					1452048,63,12
 | 
				
			||||||
 | 
					191912252,7,12
 | 
				
			||||||
 | 
					2311838590,97,12
 | 
				
			||||||
 | 
					2327979389,13,12
 | 
				
			||||||
 | 
					2341555098,11,12
 | 
				
			||||||
 | 
					2354145351,7,12
 | 
				
			||||||
 | 
					2728939,63,12
 | 
				
			||||||
 | 
					25036634,31,12
 | 
				
			||||||
 | 
					3271705843,62,12
 | 
				
			||||||
 | 
					3344297292,12,12
 | 
				
			||||||
 | 
					2350418059,79,11
 | 
				
			||||||
 | 
					15613202,32,11
 | 
				
			||||||
 | 
					2352036411,17,11
 | 
				
			||||||
 | 
					653528340,7,11
 | 
				
			||||||
 | 
					3269940677,28,11
 | 
				
			||||||
 | 
					278221281,66,11
 | 
				
			||||||
 | 
					2324844174,67,11
 | 
				
			||||||
 | 
					2317245827,7,11
 | 
				
			||||||
 | 
					3045721313,25,11
 | 
				
			||||||
 | 
					3070859372,62,11
 | 
				
			||||||
 | 
					771821595,10,11
 | 
				
			||||||
 | 
					615763365,68,11
 | 
				
			||||||
 | 
					1679596339,74,11
 | 
				
			||||||
 | 
					561545339,33,11
 | 
				
			||||||
 | 
					2311581270,19,11
 | 
				
			||||||
 | 
					888478182,9,11
 | 
				
			||||||
 | 
					3398677646,79,11
 | 
				
			||||||
 | 
					888395016,7,11
 | 
				
			||||||
 | 
					3195502499,18,11
 | 
				
			||||||
 | 
					1549474227,67,11
 | 
				
			||||||
 | 
					474279224,71,11
 | 
				
			||||||
453289520,37,10
 | 
					453289520,37,10
 | 
				
			||||||
581407487,72,10
 | 
					2313209417,32,10
 | 
				
			||||||
483081978,36,10
 | 
					 | 
				
			||||||
5007015990,74,10
 | 
					 | 
				
			||||||
495782506,19,10
 | 
					 | 
				
			||||||
5278074,36,10
 | 
					 | 
				
			||||||
561545339,33,10
 | 
					 | 
				
			||||||
560866402,9,10
 | 
					 | 
				
			||||||
1033972427,61,10
 | 
					 | 
				
			||||||
5849940,26,10
 | 
					 | 
				
			||||||
7299120,32,10
 | 
					 | 
				
			||||||
9746245,97,10
 | 
					 | 
				
			||||||
9,37,10
 | 
					 | 
				
			||||||
888478182,9,10
 | 
					 | 
				
			||||||
888395016,7,10
 | 
					 | 
				
			||||||
887840774,8,10
 | 
					 | 
				
			||||||
868012326,29,10
 | 
					 | 
				
			||||||
863079,11,10
 | 
					 | 
				
			||||||
857978527,60,10
 | 
					 | 
				
			||||||
829768,23,10
 | 
					 | 
				
			||||||
80158773,69,10
 | 
					 | 
				
			||||||
771821595,10,10
 | 
					 | 
				
			||||||
762985858,72,10
 | 
					 | 
				
			||||||
71271700,27,10
 | 
					 | 
				
			||||||
591452402,66,10
 | 
					 | 
				
			||||||
70634828,7,10
 | 
					 | 
				
			||||||
7,10,10
 | 
					 | 
				
			||||||
695995052,8,10
 | 
					 | 
				
			||||||
420984285,16,10
 | 
					 | 
				
			||||||
654825436,61,10
 | 
					 | 
				
			||||||
653528340,7,10
 | 
					 | 
				
			||||||
644292599,11,10
 | 
					 | 
				
			||||||
631449822,7,10
 | 
					 | 
				
			||||||
620220747,15,10
 | 
					 | 
				
			||||||
615763365,68,10
 | 
					 | 
				
			||||||
594378026,27,10
 | 
					 | 
				
			||||||
593312758,31,10
 | 
					 | 
				
			||||||
688155470,30,10
 | 
					 | 
				
			||||||
3070859372,62,10
 | 
					 | 
				
			||||||
4208851809,16,10
 | 
					 | 
				
			||||||
2337952436,24,10
 | 
					 | 
				
			||||||
2316990095,66,10
 | 
					 | 
				
			||||||
2317245827,7,10
 | 
					 | 
				
			||||||
2320102626,18,10
 | 
					 | 
				
			||||||
2324787028,18,10
 | 
					 | 
				
			||||||
2324844174,67,10
 | 
					 | 
				
			||||||
2326478786,60,10
 | 
					 | 
				
			||||||
2327031723,7,10
 | 
					 | 
				
			||||||
2327979389,13,10
 | 
					 | 
				
			||||||
2329375731,31,10
 | 
					 | 
				
			||||||
2333843479,70,10
 | 
					 | 
				
			||||||
2339188563,37,10
 | 
					 | 
				
			||||||
25036634,31,10
 | 
					 | 
				
			||||||
2339684065,74,10
 | 
					 | 
				
			||||||
2341555098,11,10
 | 
					 | 
				
			||||||
2343704209,69,10
 | 
					 | 
				
			||||||
2348941764,7,10
 | 
					 | 
				
			||||||
2349656760,79,10
 | 
					 | 
				
			||||||
2352036411,17,10
 | 
					 | 
				
			||||||
2354145351,7,10
 | 
					 | 
				
			||||||
2424229017,26,10
 | 
					 | 
				
			||||||
2424229017,30,10
 | 
					 | 
				
			||||||
24284343,35,10
 | 
					 | 
				
			||||||
2311838590,97,10
 | 
					 | 
				
			||||||
2311838590,34,10
 | 
					 | 
				
			||||||
2310825263,15,10
 | 
					 | 
				
			||||||
218633337,33,10
 | 
					 | 
				
			||||||
1128343125,63,10
 | 
					 | 
				
			||||||
11807506,23,10
 | 
					 | 
				
			||||||
11807506,60,10
 | 
					11807506,60,10
 | 
				
			||||||
118882692,35,10
 | 
					2324787028,18,10
 | 
				
			||||||
1217957486,31,10
 | 
					5278074,36,10
 | 
				
			||||||
1307012237,68,10
 | 
					2327031723,7,10
 | 
				
			||||||
1375606900,67,10
 | 
					 | 
				
			||||||
1452048,30,10
 | 
					 | 
				
			||||||
1452048,63,10
 | 
					 | 
				
			||||||
145511905,68,10
 | 
					 | 
				
			||||||
151606446,61,10
 | 
					 | 
				
			||||||
1549474227,67,10
 | 
					 | 
				
			||||||
15613202,32,10
 | 
					 | 
				
			||||||
159511306,69,10
 | 
					 | 
				
			||||||
1606833003,9,10
 | 
					 | 
				
			||||||
1679596339,74,10
 | 
					 | 
				
			||||||
191912252,7,10
 | 
					 | 
				
			||||||
194210021,7,10
 | 
					 | 
				
			||||||
2010673,64,10
 | 
					 | 
				
			||||||
203314437,22,10
 | 
					 | 
				
			||||||
213386023,19,10
 | 
					 | 
				
			||||||
24673506,67,10
 | 
					 | 
				
			||||||
251189644,23,10
 | 
					 | 
				
			||||||
400692942,68,10
 | 
					 | 
				
			||||||
3312358902,59,10
 | 
					 | 
				
			||||||
3188903709,65,10
 | 
					3188903709,65,10
 | 
				
			||||||
3195502499,18,10
 | 
					 | 
				
			||||||
3203777710,74,10
 | 
					 | 
				
			||||||
3211956484,34,10
 | 
					 | 
				
			||||||
3215814536,7,10
 | 
					 | 
				
			||||||
3221190269,20,10
 | 
					 | 
				
			||||||
3226664625,28,10
 | 
					 | 
				
			||||||
3267688490,73,10
 | 
					 | 
				
			||||||
3269940677,28,10
 | 
					 | 
				
			||||||
3271705843,62,10
 | 
					 | 
				
			||||||
3344297292,12,10
 | 
					 | 
				
			||||||
2545430247,25,10
 | 
					 | 
				
			||||||
3372913783,20,10
 | 
					3372913783,20,10
 | 
				
			||||||
3373311444,20,10
 | 
					695995052,8,10
 | 
				
			||||||
3373311444,71,10
 | 
					2343704209,69,10
 | 
				
			||||||
3384021594,64,10
 | 
					 | 
				
			||||||
3395900897,73,10
 | 
					 | 
				
			||||||
3398677646,79,10
 | 
					 | 
				
			||||||
3433628561,29,10
 | 
					 | 
				
			||||||
3445244192,24,10
 | 
					 | 
				
			||||||
354897041,72,10
 | 
					 | 
				
			||||||
400488703,28,10
 | 
					400488703,28,10
 | 
				
			||||||
3177507356,24,10
 | 
					118882692,35,10
 | 
				
			||||||
3147511625,7,10
 | 
					 | 
				
			||||||
3133307899,23,10
 | 
					 | 
				
			||||||
3127420424,32,10
 | 
					 | 
				
			||||||
26162741,11,10
 | 
					 | 
				
			||||||
26516263,8,10
 | 
					 | 
				
			||||||
27075840,65,10
 | 
					 | 
				
			||||||
271860868,12,10
 | 
					 | 
				
			||||||
2728939,63,10
 | 
					 | 
				
			||||||
27731896,20,10
 | 
					 | 
				
			||||||
278221281,66,10
 | 
					 | 
				
			||||||
2820140348,62,10
 | 
					 | 
				
			||||||
29954548,27,10
 | 
					 | 
				
			||||||
301209792,7,10
 | 
					 | 
				
			||||||
3025036704,17,10
 | 
					 | 
				
			||||||
3026382513,15,10
 | 
					 | 
				
			||||||
3045721313,25,10
 | 
					 | 
				
			||||||
3047163873,27,10
 | 
					3047163873,27,10
 | 
				
			||||||
3048263744,7,10
 | 
					3127420424,32,10
 | 
				
			||||||
3072715478,33,10
 | 
					151606446,61,10
 | 
				
			||||||
3103797386,7,10
 | 
					 | 
				
			||||||
3113895788,35,10
 | 
					 | 
				
			||||||
3120341363,79,10
 | 
					 | 
				
			||||||
3122923980,34,10
 | 
					3122923980,34,10
 | 
				
			||||||
996174506,15,10
 | 
					593312758,31,10
 | 
				
			||||||
11164476478,60,6
 | 
					80158773,69,10
 | 
				
			||||||
 | 
					145511905,68,10
 | 
				
			||||||
 | 
					4208851809,16,10
 | 
				
			||||||
 | 
					2311838590,34,9
 | 
				
			||||||
 | 
					2348941764,7,9
 | 
				
			||||||
 | 
					2326478786,60,9
 | 
				
			||||||
 | 
					872394725,70,9
 | 
				
			||||||
 | 
					737770776,34,9
 | 
				
			||||||
 | 
					218633337,33,9
 | 
				
			||||||
 | 
					2333843479,70,9
 | 
				
			||||||
 | 
					213386023,19,9
 | 
				
			||||||
 | 
					2337952436,24,9
 | 
				
			||||||
 | 
					1606833003,9,9
 | 
				
			||||||
 | 
					159511306,69,9
 | 
				
			||||||
 | 
					3072715478,33,9
 | 
				
			||||||
 | 
					3267688490,73,9
 | 
				
			||||||
 | 
					3026382513,15,9
 | 
				
			||||||
 | 
					3203777710,74,9
 | 
				
			||||||
 | 
					5007015990,74,9
 | 
				
			||||||
 | 
					3188352290,64,9
 | 
				
			||||||
 | 
					3177507356,24,9
 | 
				
			||||||
 | 
					620220747,15,9
 | 
				
			||||||
 | 
					3031009366,59,9
 | 
				
			||||||
 | 
					631449822,7,9
 | 
				
			||||||
 | 
					581407487,72,8
 | 
				
			||||||
 | 
					591452402,66,8
 | 
				
			||||||
 | 
					594378026,27,8
 | 
				
			||||||
 | 
					3100891962,26,8
 | 
				
			||||||
 | 
					3215814536,7,8
 | 
				
			||||||
 | 
					24673506,67,8
 | 
				
			||||||
 | 
					2339188563,37,8
 | 
				
			||||||
 | 
					29954548,27,8
 | 
				
			||||||
 | 
					2339684065,74,8
 | 
				
			||||||
 | 
					3462551351,13,8
 | 
				
			||||||
 | 
					560866402,9,7
 | 
				
			||||||
 | 
					3103797386,7,7
 | 
				
			||||||
 | 
					2320102626,18,7
 | 
				
			||||||
 | 
					3288105727,36,7
 | 
				
			||||||
 | 
					829768,23,7
 | 
				
			||||||
 | 
					2424229017,30,7
 | 
				
			||||||
 | 
					11164476478,60,7
 | 
				
			||||||
 | 
					762985858,72,7
 | 
				
			||||||
 | 
					7299120,32,7
 | 
				
			||||||
 | 
					70634828,7,7
 | 
				
			||||||
 | 
					2316990095,66,7
 | 
				
			||||||
 | 
					3025036704,17,7
 | 
				
			||||||
 | 
					3113895788,35,7
 | 
				
			||||||
 | 
					654825436,61,6
 | 
				
			||||||
 | 
					1452048,30,6
 | 
				
			||||||
 | 
					3147511625,7,6
 | 
				
			||||||
 | 
					3226664625,28,6
 | 
				
			||||||
 | 
					549184982,69,6
 | 
				
			||||||
 | 
					301209792,7,6
 | 
				
			||||||
 | 
					2545430247,25,6
 | 
				
			||||||
 | 
					2329375731,31,6
 | 
				
			||||||
 | 
					27075840,65,6
 | 
				
			||||||
 | 
					857978527,60,6
 | 
				
			||||||
 | 
					2424229017,26,6
 | 
				
			||||||
 | 
					3048263744,7,6
 | 
				
			||||||
 | 
					3433628561,29,5
 | 
				
			||||||
 | 
					517717050,36,5
 | 
				
			||||||
 | 
					495782506,19,5
 | 
				
			||||||
 | 
					483081978,36,5
 | 
				
			||||||
 | 
					27731896,20,5
 | 
				
			||||||
 | 
					3089095447,22,5
 | 
				
			||||||
 | 
					2310825263,15,4
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		
		
			
  | 
| 
						 | 
					@ -1,73 +1,73 @@
 | 
				
			||||||
id_product,count
 | 
					id_product,count
 | 
				
			||||||
50,9590
 | 
					52,5571
 | 
				
			||||||
54,8910
 | 
					55,5513
 | 
				
			||||||
53,8840
 | 
					51,4711
 | 
				
			||||||
51,8780
 | 
					53,4687
 | 
				
			||||||
52,8160
 | 
					50,4642
 | 
				
			||||||
55,7860
 | 
					54,4622
 | 
				
			||||||
99,6214
 | 
					95,3416
 | 
				
			||||||
95,4398
 | 
					49,3272
 | 
				
			||||||
46,3872
 | 
					46,3254
 | 
				
			||||||
49,3872
 | 
					48,3233
 | 
				
			||||||
47,3872
 | 
					44,3196
 | 
				
			||||||
48,3872
 | 
					45,3195
 | 
				
			||||||
45,3852
 | 
					47,3164
 | 
				
			||||||
44,3852
 | 
					99,1384
 | 
				
			||||||
90,1442
 | 
					94,1280
 | 
				
			||||||
93,1400
 | 
					93,1174
 | 
				
			||||||
94,1390
 | 
					91,1122
 | 
				
			||||||
91,1390
 | 
					90,911
 | 
				
			||||||
43,732
 | 
					92,768
 | 
				
			||||||
92,700
 | 
					41,474
 | 
				
			||||||
39,696
 | 
					42,458
 | 
				
			||||||
40,686
 | 
					43,301
 | 
				
			||||||
38,662
 | 
					39,267
 | 
				
			||||||
41,512
 | 
					38,257
 | 
				
			||||||
42,472
 | 
					40,250
 | 
				
			||||||
7,150
 | 
					7,138
 | 
				
			||||||
11,40
 | 
					23,54
 | 
				
			||||||
23,40
 | 
					11,50
 | 
				
			||||||
20,40
 | 
					68,47
 | 
				
			||||||
69,40
 | 
					20,45
 | 
				
			||||||
68,40
 | 
					67,45
 | 
				
			||||||
67,40
 | 
					34,41
 | 
				
			||||||
15,40
 | 
					61,41
 | 
				
			||||||
74,40
 | 
					 | 
				
			||||||
31,40
 | 
					31,40
 | 
				
			||||||
27,40
 | 
					8,39
 | 
				
			||||||
60,36
 | 
					62,38
 | 
				
			||||||
61,30
 | 
					32,38
 | 
				
			||||||
72,30
 | 
					27,38
 | 
				
			||||||
79,30
 | 
					74,37
 | 
				
			||||||
8,30
 | 
					64,37
 | 
				
			||||||
9,30
 | 
					63,36
 | 
				
			||||||
12,30
 | 
					15,35
 | 
				
			||||||
66,30
 | 
					69,35
 | 
				
			||||||
63,30
 | 
					79,34
 | 
				
			||||||
62,30
 | 
					24,33
 | 
				
			||||||
24,30
 | 
					60,32
 | 
				
			||||||
 | 
					35,31
 | 
				
			||||||
37,30
 | 
					37,30
 | 
				
			||||||
28,30
 | 
					33,29
 | 
				
			||||||
30,30
 | 
					72,28
 | 
				
			||||||
18,30
 | 
					18,28
 | 
				
			||||||
32,30
 | 
					9,27
 | 
				
			||||||
33,30
 | 
					73,27
 | 
				
			||||||
34,30
 | 
					36,27
 | 
				
			||||||
35,30
 | 
					28,27
 | 
				
			||||||
73,20
 | 
					66,26
 | 
				
			||||||
97,20
 | 
					30,26
 | 
				
			||||||
26,20
 | 
					26,26
 | 
				
			||||||
29,20
 | 
					12,25
 | 
				
			||||||
36,20
 | 
					10,25
 | 
				
			||||||
10,20
 | 
					19,25
 | 
				
			||||||
71,20
 | 
					97,24
 | 
				
			||||||
19,20
 | 
					71,23
 | 
				
			||||||
17,20
 | 
					59,23
 | 
				
			||||||
16,20
 | 
					16,22
 | 
				
			||||||
25,20
 | 
					13,20
 | 
				
			||||||
65,20
 | 
					70,18
 | 
				
			||||||
64,20
 | 
					17,18
 | 
				
			||||||
13,10
 | 
					22,18
 | 
				
			||||||
22,10
 | 
					25,17
 | 
				
			||||||
70,10
 | 
					29,17
 | 
				
			||||||
59,10
 | 
					65,16
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		
		
			
  | 
| 
		 Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 5.7 MiB  | 
| 
		 Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 5.9 MiB  | 
| 
		 Before Width: | Height: | Size: 9.1 MiB After Width: | Height: | Size: 13 MiB  | 
| 
						 | 
					@ -16,7 +16,7 @@ Jinja2==3.1.2
 | 
				
			||||||
joblib==1.2.0
 | 
					joblib==1.2.0
 | 
				
			||||||
kiwisolver==1.4.4
 | 
					kiwisolver==1.4.4
 | 
				
			||||||
MarkupSafe==2.1.2
 | 
					MarkupSafe==2.1.2
 | 
				
			||||||
matplotlib==3.7.5
 | 
					matplotlib==3.3.4
 | 
				
			||||||
matplotlib-inline==0.1.6
 | 
					matplotlib-inline==0.1.6
 | 
				
			||||||
multiprocess==0.70.14
 | 
					multiprocess==0.70.14
 | 
				
			||||||
mysqlclient==2.1.1
 | 
					mysqlclient==2.1.1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@ count_dcp = pd.read_csv("output_result/risk/count_dcp.csv",
 | 
				
			||||||
                            'up_id_firm': str,
 | 
					                            'up_id_firm': str,
 | 
				
			||||||
                            'down_id_firm': str
 | 
					                            'down_id_firm': str
 | 
				
			||||||
                        })
 | 
					                        })
 | 
				
			||||||
count_dcp = count_dcp[count_dcp['count'] > 35]
 | 
					count_dcp = count_dcp[count_dcp['count'] > 130]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
list_firm = count_dcp['up_id_firm'].tolist(
 | 
					list_firm = count_dcp['up_id_firm'].tolist(
 | 
				
			||||||
) + count_dcp['down_id_firm'].tolist()
 | 
					) + count_dcp['down_id_firm'].tolist()
 | 
				
			||||||
| 
						 | 
					@ -42,7 +42,7 @@ nx.set_node_attributes(G_firm, firm_labels_dict)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
count_max = count_dcp['count'].max()
 | 
					count_max = count_dcp['count'].max()
 | 
				
			||||||
count_min = count_dcp['count'].min()
 | 
					count_min = count_dcp['count'].min()
 | 
				
			||||||
k = 5 / (count_max - count_min)
 | 
					k = 15 / (count_max - count_min)
 | 
				
			||||||
for _, row in count_dcp.iterrows():
 | 
					for _, row in count_dcp.iterrows():
 | 
				
			||||||
    # print(row)
 | 
					    # print(row)
 | 
				
			||||||
    lst_add_edge = [(
 | 
					    lst_add_edge = [(
 | 
				
			||||||
| 
						 | 
					@ -53,18 +53,43 @@ for _, row in count_dcp.iterrows():
 | 
				
			||||||
            'down_id_product': row['down_id_product'],
 | 
					            'down_id_product': row['down_id_product'],
 | 
				
			||||||
            'edge_label': f"{row['up_id_product']} - {row['down_id_product']}",
 | 
					            'edge_label': f"{row['up_id_product']} - {row['down_id_product']}",
 | 
				
			||||||
            'edge_width': k * (row['count'] - count_min),
 | 
					            'edge_width': k * (row['count'] - count_min),
 | 
				
			||||||
            'count': row['count']
 | 
					            'count': (row['count'])*18
 | 
				
			||||||
        })]
 | 
					        })]
 | 
				
			||||||
    G_firm.add_edges_from(lst_add_edge)
 | 
					    G_firm.add_edges_from(lst_add_edge)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# dcp_networkx
 | 
					# dcp_networkx
 | 
				
			||||||
pos = nx.nx_agraph.graphviz_layout(G_firm, prog="dot", args="")
 | 
					pos = nx.nx_agraph.graphviz_layout(G_firm, prog="twopi", args="")
 | 
				
			||||||
node_label = nx.get_node_attributes(G_firm, '企业名称')
 | 
					node_label = nx.get_node_attributes(G_firm, '企业名称')
 | 
				
			||||||
# desensitize
 | 
					# desensitize
 | 
				
			||||||
node_label = {key: f"{key} {value}" for key, value in node_label.items()}
 | 
					node_label = {key: f"{key} " for key, value in node_label.items()}
 | 
				
			||||||
 | 
					node_label = {
 | 
				
			||||||
 | 
					  '343012684': '59',
 | 
				
			||||||
 | 
					  '2944892892': '165',
 | 
				
			||||||
 | 
					  '3269039233': '194',
 | 
				
			||||||
 | 
					  '503176785': '73',
 | 
				
			||||||
 | 
					  '3111033905': '178',
 | 
				
			||||||
 | 
					  '3215814536': '190',
 | 
				
			||||||
 | 
					  '413274977': '64',
 | 
				
			||||||
 | 
					  '2317841563': '131',
 | 
				
			||||||
 | 
					  '2354145351': '157',
 | 
				
			||||||
 | 
					  '653528340': '88',
 | 
				
			||||||
 | 
					  '888395016': '104',
 | 
				
			||||||
 | 
					  '3069206426': '174',
 | 
				
			||||||
 | 
					  '3299144127': '197',
 | 
				
			||||||
 | 
					  '2624175': '8',
 | 
				
			||||||
 | 
					  '25685135': '24',
 | 
				
			||||||
 | 
					  '2348941764': '151',
 | 
				
			||||||
 | 
					  '750610681': '95',
 | 
				
			||||||
 | 
					  '2320475044': '133',
 | 
				
			||||||
 | 
					  '571058167': '78',
 | 
				
			||||||
 | 
					  '152008168': '44',
 | 
				
			||||||
 | 
					  '448033045': '66',
 | 
				
			||||||
 | 
					  '2321109759': '134',
 | 
				
			||||||
 | 
					  '3445928818': '213'
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
node_size = list(nx.get_node_attributes(G_firm, 'Revenue_Log').values())
 | 
					node_size = list(nx.get_node_attributes(G_firm, 'Revenue_Log').values())
 | 
				
			||||||
node_size = list(map(lambda x: x ** 3, node_size))
 | 
					node_size = list(map(lambda x: x * 10, node_size))
 | 
				
			||||||
edge_label = nx.get_edge_attributes(G_firm, "edge_label")
 | 
					edge_label = nx.get_edge_attributes(G_firm, "edge_label")
 | 
				
			||||||
edge_label = {(n1, n2): label for (n1, n2, _), label in edge_label.items()}
 | 
					edge_label = {(n1, n2): label for (n1, n2, _), label in edge_label.items()}
 | 
				
			||||||
edge_width = nx.get_edge_attributes(G_firm, "edge_width")
 | 
					edge_width = nx.get_edge_attributes(G_firm, "edge_width")
 | 
				
			||||||
| 
						 | 
					@ -79,18 +104,25 @@ nx.draw(G_firm,
 | 
				
			||||||
        pos,
 | 
					        pos,
 | 
				
			||||||
        node_size=node_size,
 | 
					        node_size=node_size,
 | 
				
			||||||
        labels=node_label,
 | 
					        labels=node_label,
 | 
				
			||||||
        font_size=2,
 | 
					        font_size=8,
 | 
				
			||||||
        width=1,
 | 
					        width=2,
 | 
				
			||||||
        edge_color=colors,
 | 
					        edge_color=colors,
 | 
				
			||||||
        edge_cmap=cmap,
 | 
					        edge_cmap=cmap,
 | 
				
			||||||
        edge_vmin=vmin,
 | 
					        edge_vmin=vmin,
 | 
				
			||||||
        edge_vmax=vmax)
 | 
					        edge_vmax=vmax)
 | 
				
			||||||
# nx.draw_networkx_edge_labels(G_firm, pos, font_size=6)
 | 
					# nx.draw_networkx_edge_labels(G_firm, pos, font_size=6)
 | 
				
			||||||
 | 
					nx.draw_networkx_edge_labels(
 | 
				
			||||||
 | 
					    G_firm,
 | 
				
			||||||
 | 
					    pos,
 | 
				
			||||||
 | 
					    edge_labels=edge_label,
 | 
				
			||||||
 | 
					    font_size=5
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sm = plt.cm.ScalarMappable(cmap=cmap, norm=plt.Normalize(vmin=vmin, vmax=vmax))
 | 
					sm = plt.cm.ScalarMappable(cmap=cmap, norm=plt.Normalize(vmin=vmin, vmax=vmax))
 | 
				
			||||||
sm._A = []
 | 
					sm._A = []
 | 
				
			||||||
position = fig.add_axes([0.95, 0.05, 0.01, 0.3])
 | 
					position = fig.add_axes([0.95, 0.05, 0.01, 0.3])
 | 
				
			||||||
cb = plt.colorbar(sm, fraction=0.01, cax=position)
 | 
					cb = plt.colorbar(sm, fraction=0.01, cax=position)
 | 
				
			||||||
cb.ax.tick_params(labelsize=4)
 | 
					cb.ax.tick_params(labelsize=4)
 | 
				
			||||||
cb.outline.set_visible(False)
 | 
					cb.outline.set_visible(False)
 | 
				
			||||||
plt.savefig("output_result\\risk\\count_dcp_network_dot")
 | 
					plt.savefig("output_result\\risk\\count_dcp_network")
 | 
				
			||||||
plt.close()
 | 
					plt.close()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@ for code in g_bom.nodes:
 | 
				
			||||||
    index_list = count_prod[count_prod['id_product'] == code].index.tolist()
 | 
					    index_list = count_prod[count_prod['id_product'] == code].index.tolist()
 | 
				
			||||||
    index = index_list[0] if len(index_list) == 1 else -1
 | 
					    index = index_list[0] if len(index_list) == 1 else -1
 | 
				
			||||||
    node_attr['count'] = count_prod['count'].get(index, 0)
 | 
					    node_attr['count'] = count_prod['count'].get(index, 0)
 | 
				
			||||||
    node_attr['node_size'] = (count_prod['count'].get(index, 0) + 10) / 10
 | 
					    node_attr['node_size'] = (count_prod['count'].get(index, 0))/10
 | 
				
			||||||
    node_attr['node_color'] = count_prod['count'].get(index, 0)
 | 
					    node_attr['node_color'] = count_prod['count'].get(index, 0)
 | 
				
			||||||
    labels_dict[code] = node_attr
 | 
					    labels_dict[code] = node_attr
 | 
				
			||||||
nx.set_node_attributes(g_bom, labels_dict)
 | 
					nx.set_node_attributes(g_bom, labels_dict)
 | 
				
			||||||
| 
						 | 
					@ -45,9 +45,12 @@ colors = list(nx.get_node_attributes(g_bom, 'node_color').values())
 | 
				
			||||||
vmin = min(colors)
 | 
					vmin = min(colors)
 | 
				
			||||||
vmax = max(colors)
 | 
					vmax = max(colors)
 | 
				
			||||||
cmap = plt.cm.Blues
 | 
					cmap = plt.cm.Blues
 | 
				
			||||||
 | 
					# 创建绘图对象
 | 
				
			||||||
fig = plt.figure(figsize=(10, 10), dpi=300)
 | 
					fig = plt.figure(figsize=(10, 10), dpi=300)
 | 
				
			||||||
nx.draw(g_bom,
 | 
					ax = fig.add_subplot(111)
 | 
				
			||||||
        pos,
 | 
					
 | 
				
			||||||
 | 
					# 绘制网络图(优化样式参数)
 | 
				
			||||||
 | 
					nx.draw(g_bom, pos,
 | 
				
			||||||
        node_size=list(nx.get_node_attributes(g_bom, 'node_size').values()),
 | 
					        node_size=list(nx.get_node_attributes(g_bom, 'node_size').values()),
 | 
				
			||||||
        labels=node_labels,
 | 
					        labels=node_labels,
 | 
				
			||||||
        font_size=3,
 | 
					        font_size=3,
 | 
				
			||||||
| 
						 | 
					@ -55,14 +58,35 @@ nx.draw(g_bom,
 | 
				
			||||||
        cmap=cmap,
 | 
					        cmap=cmap,
 | 
				
			||||||
        vmin=vmin,
 | 
					        vmin=vmin,
 | 
				
			||||||
        vmax=vmax,
 | 
					        vmax=vmax,
 | 
				
			||||||
        edge_color='grey')
 | 
					        edge_color='#808080',  # 中性灰
 | 
				
			||||||
 | 
					        width=0.3,
 | 
				
			||||||
 | 
					        edgecolors='#404040',
 | 
				
			||||||
 | 
					        linewidths=0.2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 创建颜色条(修正实现方式)
 | 
				
			||||||
sm = plt.cm.ScalarMappable(cmap=cmap, norm=plt.Normalize(vmin=vmin, vmax=vmax))
 | 
					sm = plt.cm.ScalarMappable(cmap=cmap, norm=plt.Normalize(vmin=vmin, vmax=vmax))
 | 
				
			||||||
sm._A = []
 | 
					sm.set_array([])
 | 
				
			||||||
position = fig.add_axes([0.01, 0.05, 0.01, 0.3])
 | 
					
 | 
				
			||||||
cb = plt.colorbar(sm, fraction=0.01, cax=position)
 | 
					# 设置颜色条位置和样式
 | 
				
			||||||
cb.ax.tick_params(labelsize=3)
 | 
					cax = fig.add_axes([0.88, 0.3, 0.015, 0.4])  # 右侧垂直对齐
 | 
				
			||||||
cb.outline.set_visible(False)
 | 
					cb = plt.colorbar(sm, cax=cax)
 | 
				
			||||||
plt.savefig("output_result\\risk\\count_prod_network")
 | 
					cb.ax.tick_params(labelsize=4, width=0.5, colors='#333333')
 | 
				
			||||||
 | 
					cb.outline.set_linewidth(0.5)
 | 
				
			||||||
 | 
					cb.set_label('Risk Level', fontsize=5, labelpad=2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 添加图元信息
 | 
				
			||||||
 | 
					ax.set_title("Production Risk Network", fontsize=6, pad=8, color='#2F2F2F')
 | 
				
			||||||
 | 
					plt.text(0.5, 0.02, 'Data: USTB Production System | Viz: DeepSeek-R1',
 | 
				
			||||||
 | 
					         ha='center', fontsize=3, color='#666666',
 | 
				
			||||||
 | 
					         transform=fig.transFigure)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 调整边界和保存
 | 
				
			||||||
 | 
					plt.subplots_adjust(left=0.05, right=0.85, top=0.95, bottom=0.1)  # 适应颜色条
 | 
				
			||||||
 | 
					plt.savefig(r"output_result/risk/count_prod_network.png",  # 规范路径格式
 | 
				
			||||||
 | 
					           dpi=600,
 | 
				
			||||||
 | 
					           bbox_inches='tight',
 | 
				
			||||||
 | 
					           pad_inches=0.05,
 | 
				
			||||||
 | 
					           transparent=False)
 | 
				
			||||||
plt.close()
 | 
					plt.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# dcp_prod
 | 
					# dcp_prod
 | 
				
			||||||
| 
						 | 
					@ -91,8 +115,6 @@ list_prod = list(set(list_prod))
 | 
				
			||||||
BomNodes = pd.read_csv('input_data/input_product_data/BomNodes.csv')
 | 
					BomNodes = pd.read_csv('input_data/input_product_data/BomNodes.csv')
 | 
				
			||||||
BomNodes.set_index('Index', inplace=True)
 | 
					BomNodes.set_index('Index', inplace=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BomNodes.loc[13].to_dict()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
g_bom = nx.MultiDiGraph()
 | 
					g_bom = nx.MultiDiGraph()
 | 
				
			||||||
g_bom.add_nodes_from(list_prod)
 | 
					g_bom.add_nodes_from(list_prod)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -116,47 +138,86 @@ for _, row in count_dcp_prod.iterrows():
 | 
				
			||||||
    g_bom.add_edges_from(lst_add_edge)
 | 
					    g_bom.add_edges_from(lst_add_edge)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# dcp_networkx
 | 
					# dcp_networkx
 | 
				
			||||||
pos = nx.nx_agraph.graphviz_layout(g_bom, prog="dot", args="")
 | 
					pos = nx.nx_agraph.graphviz_layout(g_bom, prog="twopi", args="")
 | 
				
			||||||
node_labels = nx.get_node_attributes(g_bom, 'Name')
 | 
					node_labels = nx.get_node_attributes(g_bom, 'Name')
 | 
				
			||||||
# rename node 1
 | 
					
 | 
				
			||||||
# node_labels['1'] = '解决方案'
 | 
					 | 
				
			||||||
temp = {}
 | 
					temp = {}
 | 
				
			||||||
for key, value in node_labels.items():
 | 
					for key, value in node_labels.items():
 | 
				
			||||||
    temp[key] = str(key) + " " + value
 | 
					    temp[key] = str(key) + " " + value
 | 
				
			||||||
node_labels = temp
 | 
					node_labels = temp
 | 
				
			||||||
 | 
					node_labels ={
 | 
				
			||||||
 | 
					    38: 'SiC Substrate',
 | 
				
			||||||
 | 
					    39: 'GaN Substrate',
 | 
				
			||||||
 | 
					    40: 'Si Substrate',
 | 
				
			||||||
 | 
					    41: 'AlN Substrate',
 | 
				
			||||||
 | 
					    42: 'DUV LED Substrate',
 | 
				
			||||||
 | 
					    43: 'InP Substrate',
 | 
				
			||||||
 | 
					    44: 'Mono-Si Wafer',
 | 
				
			||||||
 | 
					    45: 'Poly-Si Wafer',
 | 
				
			||||||
 | 
					    46: 'InP Cryst./Wafer',
 | 
				
			||||||
 | 
					    47: 'SiC Cryst./Wafer',
 | 
				
			||||||
 | 
					    48: 'GaAs Wafer',
 | 
				
			||||||
 | 
					    49: 'GaN Cryst./Wafer',
 | 
				
			||||||
 | 
					    50: 'Si Epi Wafer',
 | 
				
			||||||
 | 
					    51: 'SiC Epi Wafer',
 | 
				
			||||||
 | 
					    52: 'AlN Epi',
 | 
				
			||||||
 | 
					    53: 'GaN Epi',
 | 
				
			||||||
 | 
					    54: 'InP Epi',
 | 
				
			||||||
 | 
					    55: 'LED Epi Wafer',
 | 
				
			||||||
 | 
					    90: 'Power Devices',
 | 
				
			||||||
 | 
					    91: 'Diode',
 | 
				
			||||||
 | 
					    92: 'Transistor',
 | 
				
			||||||
 | 
					    93: 'Thyristor',
 | 
				
			||||||
 | 
					    94: 'Rectifier',
 | 
				
			||||||
 | 
					    95: 'IC Fab',
 | 
				
			||||||
 | 
					    99: 'Wafer Test'
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
colors = nx.get_edge_attributes(g_bom, "count")
 | 
					colors = nx.get_edge_attributes(g_bom, "count")
 | 
				
			||||||
colors = [w for (n1, n2, _), w in colors.items()]
 | 
					colors = [w for (n1, n2, _), w in colors.items()]
 | 
				
			||||||
vmin = min(colors)
 | 
					vmin = min(colors)
 | 
				
			||||||
vmax = max(colors)
 | 
					vmax = max(colors)
 | 
				
			||||||
cmap = plt.cm.Blues
 | 
					cmap = plt.cm.Blues
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pos_new = {}
 | 
					pos_new = {node: (p[1], p[0]) for node, p in pos.items()}  # 字典推导式优化
 | 
				
			||||||
for node, p in pos.items():
 | 
					 | 
				
			||||||
    pos_new[node] = (p[1], p[0])
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
fig = plt.figure(figsize=(6, 6), dpi=500)
 | 
					fig = plt.figure(figsize=(8, 8), dpi=300)
 | 
				
			||||||
# plt.subplots_adjust(right=0.7)
 | 
					plt.subplots_adjust(right=0.85)  # 关键调整:右侧保留15%空白
 | 
				
			||||||
nx.draw(g_bom,
 | 
					
 | 
				
			||||||
        pos_new,
 | 
					# 使用Axes对象精准控制
 | 
				
			||||||
        node_size=25,
 | 
					main_ax = fig.add_axes([0.1, 0.1, 0.75, 0.8])  # 主图占左75%宽,上下各留10%边距
 | 
				
			||||||
 | 
					nx.draw(g_bom, pos_new,
 | 
				
			||||||
 | 
					        ax=main_ax,
 | 
				
			||||||
 | 
					        node_size=50,
 | 
				
			||||||
        labels=node_labels,
 | 
					        labels=node_labels,
 | 
				
			||||||
        font_size=5,
 | 
					        font_size=5,
 | 
				
			||||||
        width=0.5,
 | 
					        width=1.5,
 | 
				
			||||||
        edge_color=colors,
 | 
					        edge_color=colors,
 | 
				
			||||||
        edge_cmap=cmap,
 | 
					        edge_cmap=cmap,
 | 
				
			||||||
        edge_vmin=vmin,
 | 
					        edge_vmin=vmin,
 | 
				
			||||||
        edge_vmax=vmax,
 | 
					        edge_vmax=vmax,
 | 
				
			||||||
        alpha=1)
 | 
					        )
 | 
				
			||||||
plt.axis('off')
 | 
					main_ax.axis('off')
 | 
				
			||||||
axis = plt.gca()
 | 
					 | 
				
			||||||
axis.set_xlim([1 * x for x in axis.get_xlim()])
 | 
					 | 
				
			||||||
axis.set_ylim([1 * y for y in axis.get_ylim()])
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 颜色条定位系统
 | 
				
			||||||
 | 
					cbar_ax = fig.add_axes([0.86, 0.15, 0.015, 0.3])  # 右边缘86%位置,底部15%起,占30%高度
 | 
				
			||||||
sm = plt.cm.ScalarMappable(cmap=cmap, norm=plt.Normalize(vmin=vmin, vmax=vmax))
 | 
					sm = plt.cm.ScalarMappable(cmap=cmap, norm=plt.Normalize(vmin=vmin, vmax=vmax))
 | 
				
			||||||
sm._A = []
 | 
					sm._A = []  # 必需的空数组
 | 
				
			||||||
position = fig.add_axes([0.85, 0.75, 0.01, 0.2])
 | 
					
 | 
				
			||||||
cb = plt.colorbar(sm, fraction=0.01, cax=position)
 | 
					# 微调颜色条样式
 | 
				
			||||||
cb.ax.tick_params(labelsize=3)
 | 
					cbar = fig.colorbar(sm, cax=cbar_ax, orientation='vertical')
 | 
				
			||||||
cb.outline.set_visible(False)
 | 
					cbar.ax.tick_params(labelsize=4,
 | 
				
			||||||
plt.savefig("output_result\\risk\\count_dcp_prod_network")
 | 
					                    width=0.3,    # 刻度线粗细
 | 
				
			||||||
 | 
					                    length=1.5,   # 刻度线长度
 | 
				
			||||||
 | 
					                    pad=0.8)      # 标签与条间距
 | 
				
			||||||
 | 
					cbar.outline.set_linewidth(0.5)   # 边框线宽
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 输出前验证边界
 | 
				
			||||||
 | 
					print(f"Colorbar position: {cbar_ax.get_position().bounds}")  # 应输出(0.86,0.15,0.015,0.3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 专业级保存参数
 | 
				
			||||||
 | 
					plt.savefig("output_result/risk/count_dcp_prod_network.png",
 | 
				
			||||||
 | 
					            dpi=900,
 | 
				
			||||||
 | 
					            bbox_inches='tight',  # 自动裁剪白边
 | 
				
			||||||
 | 
					            pad_inches=0.05,      # 保留0.05英寸边距
 | 
				
			||||||
 | 
					            metadata={'CreationDate': None})  # 避免时间戳污染元数据
 | 
				
			||||||
plt.close()
 | 
					plt.close()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -40,12 +40,142 @@ if G_bom_str is None:
 | 
				
			||||||
G_bom = nx.adjacency_graph(json.loads(G_bom_str))
 | 
					G_bom = nx.adjacency_graph(json.loads(G_bom_str))
 | 
				
			||||||
pos = nx.nx_agraph.graphviz_layout(G_bom, prog="twopi", args="")
 | 
					pos = nx.nx_agraph.graphviz_layout(G_bom, prog="twopi", args="")
 | 
				
			||||||
node_labels = nx.get_node_attributes(G_bom, 'Name')
 | 
					node_labels = nx.get_node_attributes(G_bom, 'Name')
 | 
				
			||||||
 | 
					node_labels = {
 | 
				
			||||||
 | 
					    7: 'Si Raw Mtl.',
 | 
				
			||||||
 | 
					    8: 'Photoresist & Reagents',
 | 
				
			||||||
 | 
					    9: 'Etch Solution',
 | 
				
			||||||
 | 
					    10: 'SiF4',
 | 
				
			||||||
 | 
					    11: 'Developer',
 | 
				
			||||||
 | 
					    12: 'PCE Superplasticizer',
 | 
				
			||||||
 | 
					    13: 'Metal Protectant',
 | 
				
			||||||
 | 
					    14: 'Deep Hole Cu Plating',
 | 
				
			||||||
 | 
					    15: 'Thinner',
 | 
				
			||||||
 | 
					    16: 'HP Boric Acid (Nuc.)',
 | 
				
			||||||
 | 
					    17: 'E-Grade Epoxy',
 | 
				
			||||||
 | 
					    18: 'Stripper',
 | 
				
			||||||
 | 
					    19: 'HP-MOC',
 | 
				
			||||||
 | 
					    20: 'CMP Slurry & Consumables',
 | 
				
			||||||
 | 
					    21: 'PR Remover',
 | 
				
			||||||
 | 
					    22: 'Poly-Si Cutting Fluid',
 | 
				
			||||||
 | 
					    23: 'Passivation',
 | 
				
			||||||
 | 
					    24: 'E-Grade Phenolic',
 | 
				
			||||||
 | 
					    25: 'Surfactant',
 | 
				
			||||||
 | 
					    26: 'Mag. Carrier',
 | 
				
			||||||
 | 
					    27: 'Wet Chems.',
 | 
				
			||||||
 | 
					    28: 'Plating Chems.',
 | 
				
			||||||
 | 
					    29: 'E-FR Materials',
 | 
				
			||||||
 | 
					    30: 'LC Alignment Agent',
 | 
				
			||||||
 | 
					    31: 'Func. Wet Chems.',
 | 
				
			||||||
 | 
					    32: 'InP',
 | 
				
			||||||
 | 
					    33: 'SiC',
 | 
				
			||||||
 | 
					    34: 'GaAs',
 | 
				
			||||||
 | 
					    35: 'GaN',
 | 
				
			||||||
 | 
					    36: 'AlN',
 | 
				
			||||||
 | 
					    37: 'Si3N4',
 | 
				
			||||||
 | 
					    38: 'SiC Substrate',
 | 
				
			||||||
 | 
					    39: 'GaN Substrate',
 | 
				
			||||||
 | 
					    40: 'Si Wafer',
 | 
				
			||||||
 | 
					    41: 'AlN Substrate',
 | 
				
			||||||
 | 
					    42: 'DUV LED Substrate',
 | 
				
			||||||
 | 
					    43: 'InP Substrate',
 | 
				
			||||||
 | 
					    44: 'Mono-Si Wafer',
 | 
				
			||||||
 | 
					    45: 'Poly-Si Wafer',
 | 
				
			||||||
 | 
					    46: 'InP Cryst./Wafer',
 | 
				
			||||||
 | 
					    47: 'SiC Cryst./Wafer',
 | 
				
			||||||
 | 
					    48: 'GaAs Wafer',
 | 
				
			||||||
 | 
					    49: 'GaN Cryst./Wafer',
 | 
				
			||||||
 | 
					    50: 'Si Epi Wafer',
 | 
				
			||||||
 | 
					    51: 'SiC Epi Wafer',
 | 
				
			||||||
 | 
					    52: 'AlN Epi',
 | 
				
			||||||
 | 
					    53: 'GaN Epi',
 | 
				
			||||||
 | 
					    54: 'InP Epi',
 | 
				
			||||||
 | 
					    55: 'LED Epi',
 | 
				
			||||||
 | 
					    56: 'EDA/IP',
 | 
				
			||||||
 | 
					    57: 'MPW Service',
 | 
				
			||||||
 | 
					    58: 'IC Design',
 | 
				
			||||||
 | 
					    59: 'Track System',
 | 
				
			||||||
 | 
					    60: 'Wafer Grinder',
 | 
				
			||||||
 | 
					    61: 'Etcher',
 | 
				
			||||||
 | 
					    62: 'Ox/Diff Furnace',
 | 
				
			||||||
 | 
					    63: 'Wafer Metrology',
 | 
				
			||||||
 | 
					    64: 'Crystal Grower',
 | 
				
			||||||
 | 
					    65: 'CMP Tool',
 | 
				
			||||||
 | 
					    66: 'Stepper',
 | 
				
			||||||
 | 
					    67: 'Wafer Dicer',
 | 
				
			||||||
 | 
					    68: 'Deposition System',
 | 
				
			||||||
 | 
					    69: 'Edge Profiler',
 | 
				
			||||||
 | 
					    70: 'Descum Tool',
 | 
				
			||||||
 | 
					    71: 'Clean System',
 | 
				
			||||||
 | 
					    72: 'SAF',
 | 
				
			||||||
 | 
					    73: 'Plating Eqpt.',
 | 
				
			||||||
 | 
					    74: 'Implanter',
 | 
				
			||||||
 | 
					    75: 'Trim/Form',
 | 
				
			||||||
 | 
					    76: 'Probe Card',
 | 
				
			||||||
 | 
					    77: 'ATE',
 | 
				
			||||||
 | 
					    78: 'PCM Eqpt.',
 | 
				
			||||||
 | 
					    79: 'Inspection Sys.',
 | 
				
			||||||
 | 
					    80: 'Prober',
 | 
				
			||||||
 | 
					    81: 'Dicing Saw',
 | 
				
			||||||
 | 
					    82: 'Handler',
 | 
				
			||||||
 | 
					    83: 'Backgrinder',
 | 
				
			||||||
 | 
					    84: 'Die Bonder',
 | 
				
			||||||
 | 
					    85: 'Reflow Oven',
 | 
				
			||||||
 | 
					    86: 'FT Tester',
 | 
				
			||||||
 | 
					    87: 'Wire Bonder',
 | 
				
			||||||
 | 
					    88: 'BGA Mounter',
 | 
				
			||||||
 | 
					    89: 'Molding Press',
 | 
				
			||||||
 | 
					    90: 'Power Devices',
 | 
				
			||||||
 | 
					    91: 'Diode',
 | 
				
			||||||
 | 
					    92: 'Transistor',
 | 
				
			||||||
 | 
					    93: 'Thyristor',
 | 
				
			||||||
 | 
					    94: 'Rectifier',
 | 
				
			||||||
 | 
					    95: 'IC Fab',
 | 
				
			||||||
 | 
					    96: 'IC PKG',
 | 
				
			||||||
 | 
					    97: 'DV',
 | 
				
			||||||
 | 
					    98: 'IPM',
 | 
				
			||||||
 | 
					    99: 'CP Test',
 | 
				
			||||||
 | 
					    100: 'FT Test',
 | 
				
			||||||
 | 
					    101: 'Bumping',
 | 
				
			||||||
 | 
					    102: 'DA Materials',
 | 
				
			||||||
 | 
					    103: 'Leadframe',
 | 
				
			||||||
 | 
					    104: 'Solder Ball',
 | 
				
			||||||
 | 
					    105: 'Substrate',
 | 
				
			||||||
 | 
					    106: 'EMC',
 | 
				
			||||||
 | 
					    107: 'Bond Wire',
 | 
				
			||||||
 | 
					    108: 'Underfill',
 | 
				
			||||||
 | 
					    109: 'Dicing Tape'
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					plt.figure(figsize=(12, 12), dpi=500)
 | 
				
			||||||
 | 
					plt.axis('off')  # 关闭坐标轴边框
 | 
				
			||||||
 | 
					
 | 
				
			||||||
plt.figure(figsize=(12, 12), dpi=300)
 | 
					# 优化节点绘制参数
 | 
				
			||||||
nx.draw_networkx_nodes(G_bom, pos)
 | 
					nx.draw_networkx_nodes(
 | 
				
			||||||
nx.draw_networkx_edges(G_bom, pos)
 | 
					    G_bom, pos,
 | 
				
			||||||
nx.draw_networkx_labels(G_bom, pos, labels=node_labels, font_size=3)
 | 
					    node_size=100,               # 优化节点尺寸
 | 
				
			||||||
plt.savefig(f"output_result/risk/g_bom_exp_id_{exp_id}.png")
 | 
					    linewidths=0.0              # 去除节点边框
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					# 优化边绘制参数
 | 
				
			||||||
 | 
					nx.draw_networkx_edges(
 | 
				
			||||||
 | 
					    G_bom, pos,
 | 
				
			||||||
 | 
					    width=0.3,                  # 更细的边宽
 | 
				
			||||||
 | 
					    alpha=0.5                   # 半透明边
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					# 优化标签参数
 | 
				
			||||||
 | 
					nx.draw_networkx_labels(
 | 
				
			||||||
 | 
					    G_bom, pos,
 | 
				
			||||||
 | 
					    labels=node_labels,
 | 
				
			||||||
 | 
					    font_size=3,                # 适当增大字号
 | 
				
			||||||
 | 
					    font_family='sans-serif',   # 使用无衬线字体
 | 
				
			||||||
 | 
					    font_weight='bold',         # 增强可读性
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 专业级保存参数设置
 | 
				
			||||||
 | 
					plt.savefig(
 | 
				
			||||||
 | 
					    f"output_result/risk/g_bom_exp_id_{exp_id}.png",
 | 
				
			||||||
 | 
					    bbox_inches='tight',        # 去除图像白边
 | 
				
			||||||
 | 
					    pad_inches=0.1,             # 适当内边距
 | 
				
			||||||
 | 
					    facecolor='white'           # 保证背景纯白
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
plt.close()
 | 
					plt.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# G_firm
 | 
					# G_firm
 | 
				
			||||||
| 
						 | 
					@ -77,14 +207,228 @@ G_firm.remove_nodes_from(isolated_nodes)   # 从图中移除这些节点
 | 
				
			||||||
# 2. 重新布局和绘图
 | 
					# 2. 重新布局和绘图
 | 
				
			||||||
pos = nx.nx_agraph.graphviz_layout(G_firm, prog="twopi", args="")
 | 
					pos = nx.nx_agraph.graphviz_layout(G_firm, prog="twopi", args="")
 | 
				
			||||||
node_label = {key: key for key in nx.get_node_attributes(G_firm, 'Revenue_Log').keys()}
 | 
					node_label = {key: key for key in nx.get_node_attributes(G_firm, 'Revenue_Log').keys()}
 | 
				
			||||||
node_size = [value * 10 for value in nx.get_node_attributes(G_firm, 'Revenue_Log').values()]  # 节点大小扩大10倍
 | 
					node_label = {
 | 
				
			||||||
 | 
					    "7": "1",
 | 
				
			||||||
 | 
					    "9": "2",
 | 
				
			||||||
 | 
					    "829768": "4",
 | 
				
			||||||
 | 
					    "863079": "5",
 | 
				
			||||||
 | 
					    "1452048": "6",
 | 
				
			||||||
 | 
					    "2010673": "7",
 | 
				
			||||||
 | 
					    "2624175": "8",
 | 
				
			||||||
 | 
					    "2728939": "9",
 | 
				
			||||||
 | 
					    "5278074": "10",
 | 
				
			||||||
 | 
					    "5849940": "11",
 | 
				
			||||||
 | 
					    "7299120": "12",
 | 
				
			||||||
 | 
					    "9746245": "13",
 | 
				
			||||||
 | 
					    "11807506": "14",
 | 
				
			||||||
 | 
					    "15613202": "15",
 | 
				
			||||||
 | 
					    "24284343": "19",
 | 
				
			||||||
 | 
					    "24673506": "20",
 | 
				
			||||||
 | 
					    "25036634": "21",
 | 
				
			||||||
 | 
					    "25685135": "24",
 | 
				
			||||||
 | 
					    "25945288": "25",
 | 
				
			||||||
 | 
					    "26162741": "26",
 | 
				
			||||||
 | 
					    "26516263": "27",
 | 
				
			||||||
 | 
					    "27075840": "28",
 | 
				
			||||||
 | 
					    "27731896": "29",
 | 
				
			||||||
 | 
					    "29954548": "30",
 | 
				
			||||||
 | 
					    "43407343": "33",
 | 
				
			||||||
 | 
					    "70634828": "36",
 | 
				
			||||||
 | 
					    "71271700": "37",
 | 
				
			||||||
 | 
					    "80158773": "39",
 | 
				
			||||||
 | 
					    "118882692": "40",
 | 
				
			||||||
 | 
					    "145511905": "42",
 | 
				
			||||||
 | 
					    "151606446": "43",
 | 
				
			||||||
 | 
					    "152008168": "44",
 | 
				
			||||||
 | 
					    "159511306": "45",
 | 
				
			||||||
 | 
					    "191912252": "46",
 | 
				
			||||||
 | 
					    "194210021": "47",
 | 
				
			||||||
 | 
					    "203314437": "48",
 | 
				
			||||||
 | 
					    "213386023": "49",
 | 
				
			||||||
 | 
					    "218633337": "50",
 | 
				
			||||||
 | 
					    "251189644": "53",
 | 
				
			||||||
 | 
					    "271860868": "55",
 | 
				
			||||||
 | 
					    "278221281": "56",
 | 
				
			||||||
 | 
					    "301209792": "57",
 | 
				
			||||||
 | 
					    "343012684": "59",
 | 
				
			||||||
 | 
					    "354897041": "60",
 | 
				
			||||||
 | 
					    "400488703": "62",
 | 
				
			||||||
 | 
					    "400692942": "63",
 | 
				
			||||||
 | 
					    "413274977": "64",
 | 
				
			||||||
 | 
					    "420984285": "65",
 | 
				
			||||||
 | 
					    "448033045": "66",
 | 
				
			||||||
 | 
					    "453289520": "67",
 | 
				
			||||||
 | 
					    "474279224": "68",
 | 
				
			||||||
 | 
					    "483081978": "69",
 | 
				
			||||||
 | 
					    "495782506": "70",
 | 
				
			||||||
 | 
					    "503176785": "73",
 | 
				
			||||||
 | 
					    "549184982": "75",
 | 
				
			||||||
 | 
					    "560866402": "76",
 | 
				
			||||||
 | 
					    "561545339": "77",
 | 
				
			||||||
 | 
					    "571058167": "78",
 | 
				
			||||||
 | 
					    "581407487": "79",
 | 
				
			||||||
 | 
					    "591452402": "80",
 | 
				
			||||||
 | 
					    "593312758": "81",
 | 
				
			||||||
 | 
					    "594378026": "82",
 | 
				
			||||||
 | 
					    "607512171": "83",
 | 
				
			||||||
 | 
					    "615763365": "84",
 | 
				
			||||||
 | 
					    "620220747": "85",
 | 
				
			||||||
 | 
					    "631449822": "86",
 | 
				
			||||||
 | 
					    "644292599": "87",
 | 
				
			||||||
 | 
					    "653528340": "88",
 | 
				
			||||||
 | 
					    "654825436": "89",
 | 
				
			||||||
 | 
					    "688155470": "92",
 | 
				
			||||||
 | 
					    "695995052": "93",
 | 
				
			||||||
 | 
					    "750610681": "95",
 | 
				
			||||||
 | 
					    "762985858": "96",
 | 
				
			||||||
 | 
					    "771821595": "97",
 | 
				
			||||||
 | 
					    "857978527": "100",
 | 
				
			||||||
 | 
					    "868012326": "101",
 | 
				
			||||||
 | 
					    "887840774": "102",
 | 
				
			||||||
 | 
					    "888356483": "103",
 | 
				
			||||||
 | 
					    "888395016": "104",
 | 
				
			||||||
 | 
					    "888478182": "105",
 | 
				
			||||||
 | 
					    "930767828": "107",
 | 
				
			||||||
 | 
					    "996174506": "108",
 | 
				
			||||||
 | 
					    "1033972427": "110",
 | 
				
			||||||
 | 
					    "1128343125": "111",
 | 
				
			||||||
 | 
					    "1217957486": "113",
 | 
				
			||||||
 | 
					    "1307012237": "115",
 | 
				
			||||||
 | 
					    "1375606900": "116",
 | 
				
			||||||
 | 
					    "1549474227": "118",
 | 
				
			||||||
 | 
					    "1606833003": "120",
 | 
				
			||||||
 | 
					    "1679596339": "121",
 | 
				
			||||||
 | 
					    "2310825263": "122",
 | 
				
			||||||
 | 
					    "2311838590": "124",
 | 
				
			||||||
 | 
					    "2312490120": "125",
 | 
				
			||||||
 | 
					    "2316990095": "128",
 | 
				
			||||||
 | 
					    "2317245827": "129",
 | 
				
			||||||
 | 
					    "2317841563": "131",
 | 
				
			||||||
 | 
					    "2320102626": "132",
 | 
				
			||||||
 | 
					    "2320475044": "133",
 | 
				
			||||||
 | 
					    "2321109759": "134",
 | 
				
			||||||
 | 
					    "2324787028": "137",
 | 
				
			||||||
 | 
					    "2324844174": "138",
 | 
				
			||||||
 | 
					    "2326478786": "139",
 | 
				
			||||||
 | 
					    "2327031723": "140",
 | 
				
			||||||
 | 
					    "2327979389": "141",
 | 
				
			||||||
 | 
					    "2329375731": "142",
 | 
				
			||||||
 | 
					    "2333843479": "143",
 | 
				
			||||||
 | 
					    "2337952436": "146",
 | 
				
			||||||
 | 
					    "2339188563": "147",
 | 
				
			||||||
 | 
					    "2339684065": "148",
 | 
				
			||||||
 | 
					    "2341555098": "149",
 | 
				
			||||||
 | 
					    "2343704209": "150",
 | 
				
			||||||
 | 
					    "2348941764": "151",
 | 
				
			||||||
 | 
					    "2352036411": "155",
 | 
				
			||||||
 | 
					    "2354145351": "157",
 | 
				
			||||||
 | 
					    "2424229017": "159",
 | 
				
			||||||
 | 
					    "2545430247": "161",
 | 
				
			||||||
 | 
					    "2820140348": "163",
 | 
				
			||||||
 | 
					    "2944892892": "165",
 | 
				
			||||||
 | 
					    "3025036704": "168",
 | 
				
			||||||
 | 
					    "3026382513": "169",
 | 
				
			||||||
 | 
					    "3045721313": "171",
 | 
				
			||||||
 | 
					    "3047163873": "172",
 | 
				
			||||||
 | 
					    "3048263744": "173",
 | 
				
			||||||
 | 
					    "3069206426": "174",
 | 
				
			||||||
 | 
					    "3070859372": "175",
 | 
				
			||||||
 | 
					    "3072715478": "176",
 | 
				
			||||||
 | 
					    "3103797386": "177",
 | 
				
			||||||
 | 
					    "3111033905": "178",
 | 
				
			||||||
 | 
					    "3113895788": "179",
 | 
				
			||||||
 | 
					    "3120341363": "180",
 | 
				
			||||||
 | 
					    "3122923980": "181",
 | 
				
			||||||
 | 
					    "3127420424": "182",
 | 
				
			||||||
 | 
					    "3133307899": "183",
 | 
				
			||||||
 | 
					    "3147511625": "184",
 | 
				
			||||||
 | 
					    "3177507356": "185",
 | 
				
			||||||
 | 
					    "3188903709": "186",
 | 
				
			||||||
 | 
					    "3195502499": "187",
 | 
				
			||||||
 | 
					    "3203777710": "188",
 | 
				
			||||||
 | 
					    "3211956484": "189",
 | 
				
			||||||
 | 
					    "3215814536": "190",
 | 
				
			||||||
 | 
					    "3221190269": "191",
 | 
				
			||||||
 | 
					    "3226664625": "192",
 | 
				
			||||||
 | 
					    "3267688490": "193",
 | 
				
			||||||
 | 
					    "3269039233": "194",
 | 
				
			||||||
 | 
					    "3269940677": "195",
 | 
				
			||||||
 | 
					    "3271705843": "196",
 | 
				
			||||||
 | 
					    "3299144127": "197",
 | 
				
			||||||
 | 
					    "3312358902": "198",
 | 
				
			||||||
 | 
					    "3344297292": "200",
 | 
				
			||||||
 | 
					    "3372913783": "201",
 | 
				
			||||||
 | 
					    "3373311444": "202",
 | 
				
			||||||
 | 
					    "3384021594": "203",
 | 
				
			||||||
 | 
					    "3395900897": "205",
 | 
				
			||||||
 | 
					    "3398677646": "206",
 | 
				
			||||||
 | 
					    "3407754893": "207",
 | 
				
			||||||
 | 
					    "3433628561": "209",
 | 
				
			||||||
 | 
					    "3445244192": "212",
 | 
				
			||||||
 | 
					    "3445928818": "213",
 | 
				
			||||||
 | 
					    "4208851809": "216",
 | 
				
			||||||
 | 
					    "5007015990": "218",
 | 
				
			||||||
 | 
					    "11164476478": "219",
 | 
				
			||||||
 | 
					    "517717050": "223",
 | 
				
			||||||
 | 
					    "737770776": "224",
 | 
				
			||||||
 | 
					    "872394725": "225",
 | 
				
			||||||
 | 
					    "2311581270": "226",
 | 
				
			||||||
 | 
					    "2313209417": "227",
 | 
				
			||||||
 | 
					    "2347013470": "228",
 | 
				
			||||||
 | 
					    "2350418059": "229",
 | 
				
			||||||
 | 
					    "3031009366": "234",
 | 
				
			||||||
 | 
					    "3089095447": "235",
 | 
				
			||||||
 | 
					    "3100891962": "236",
 | 
				
			||||||
 | 
					    "3188352290": "238",
 | 
				
			||||||
 | 
					    "3288105727": "239",
 | 
				
			||||||
 | 
					    "3462551351": "240"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					node_size = [value * 5 for value in nx.get_node_attributes(G_firm, 'Revenue_Log').values()]
 | 
				
			||||||
edge_label = {(n1, n2): label for (n1, n2, _), label in nx.get_edge_attributes(G_firm, "Product").items()}
 | 
					edge_label = {(n1, n2): label for (n1, n2, _), label in nx.get_edge_attributes(G_firm, "Product").items()}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
plt.figure(figsize=(12, 12), dpi=500)
 | 
					plt.figure(figsize=(15, 15), dpi=500)
 | 
				
			||||||
nx.draw(G_firm, pos, node_size=node_size, labels=node_label, font_size=5, width=0.5)
 | 
					plt.axis('off')  # 完全关闭坐标轴系统
 | 
				
			||||||
nx.draw_networkx_edge_labels(G_firm, pos, edge_label, font_size=2)
 | 
					
 | 
				
			||||||
plt.axis('equal')  # 锁定坐标轴比例,确保图形内容是正方形
 | 
					# 分层绘制网络组件
 | 
				
			||||||
plt.savefig(f"output_result/risk/g_firm_sample_id_{sample_id}_de.png", bbox_inches='tight', pad_inches=0.1)
 | 
					nodes = nx.draw_networkx_nodes(
 | 
				
			||||||
 | 
					    G_firm, pos,
 | 
				
			||||||
 | 
					    node_size=node_size,        # 保持原始尺寸设置
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					edges = nx.draw_networkx_edges(
 | 
				
			||||||
 | 
					    G_firm, pos,
 | 
				
			||||||
 | 
					    width=0.3,                  # 保持原始线宽设置
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 优化节点标签
 | 
				
			||||||
 | 
					labels = nx.draw_networkx_labels(
 | 
				
			||||||
 | 
					    G_firm, pos,
 | 
				
			||||||
 | 
					    labels=node_label,
 | 
				
			||||||
 | 
					    font_size=6,                # 保持原始字号
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 增强边标签可读性
 | 
				
			||||||
 | 
					edge_labels = nx.draw_networkx_edge_labels(
 | 
				
			||||||
 | 
					    G_firm, pos,
 | 
				
			||||||
 | 
					    edge_labels=edge_label,
 | 
				
			||||||
 | 
					    font_size=2,
 | 
				
			||||||
 | 
					    label_pos=0.5,              # 标签沿边偏移量
 | 
				
			||||||
 | 
					    rotate=False,              # 禁止自动旋转
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 专业级输出配置
 | 
				
			||||||
 | 
					plt.savefig(
 | 
				
			||||||
 | 
					    f"output_result/risk/g_firm_sample_id_{sample_id}_de.png",
 | 
				
			||||||
 | 
					    bbox_inches='tight',
 | 
				
			||||||
 | 
					    pad_inches=0.05,            # 更紧凑的边距
 | 
				
			||||||
 | 
					    facecolor='white',          # 强制白色背景
 | 
				
			||||||
 | 
					    metadata={
 | 
				
			||||||
 | 
					        'Title': f"Supply Chain Risk Map - Sample {sample_id}",
 | 
				
			||||||
 | 
					        'Author': 'USTB Risk Analytics',
 | 
				
			||||||
 | 
					        'Copyright': 'Confidential'
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
plt.close()
 | 
					plt.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,50 @@
 | 
				
			||||||
 | 
					import pandas as pd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 读取数据
 | 
				
			||||||
 | 
					df = pd.read_csv('input_data/input_firm_data/firm_amended.csv')  # 替换为你的 CSV 文件路径
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 要分析的列
 | 
				
			||||||
 | 
					columns = [
 | 
				
			||||||
 | 
					    "固定资产原值(万元人民币)",
 | 
				
			||||||
 | 
					    "固定资产净值(万元人民币)",
 | 
				
			||||||
 | 
					    "资产总和(万元人民币)",
 | 
				
			||||||
 | 
					    "存货(万元人民币)"
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 字段类型定义(可人工定义,也可自动判断)
 | 
				
			||||||
 | 
					column_types = {
 | 
				
			||||||
 | 
					    "固定资产原值(万元人民币)": "连续型",
 | 
				
			||||||
 | 
					    "固定资产净值(万元人民币)": "连续型",
 | 
				
			||||||
 | 
					    "资产总和(万元人民币)": "连续型",
 | 
				
			||||||
 | 
					    "存货(万元人民币)": "连续型"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 统计分析
 | 
				
			||||||
 | 
					summary = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for col in columns:
 | 
				
			||||||
 | 
					    data = df[col].dropna()
 | 
				
			||||||
 | 
					    summary.append({
 | 
				
			||||||
 | 
					        "字段名": col,
 | 
				
			||||||
 | 
					        "类型": column_types[col],
 | 
				
			||||||
 | 
					        "计数(非空)": data.count(),
 | 
				
			||||||
 | 
					        "均值": data.mean(),
 | 
				
			||||||
 | 
					        "标准差": data.std(),
 | 
				
			||||||
 | 
					        "最小值": data.min(),
 | 
				
			||||||
 | 
					        "中位数": data.median(),
 | 
				
			||||||
 | 
					        "最大值": data.max()
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 转为 DataFrame 展示
 | 
				
			||||||
 | 
					summary_df = pd.DataFrame(summary)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 设置列顺序
 | 
				
			||||||
 | 
					summary_df = summary_df[["字段名", "类型", "计数(非空)", "均值", "标准差", "最小值", "中位数", "最大值"]]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 打印结果
 | 
				
			||||||
 | 
					print(summary_df)
 | 
				
			||||||
 | 
					# 保存为 Excel 文件
 | 
				
			||||||
 | 
					output_path = "企业规模数据描述性统计表.xlsx"
 | 
				
			||||||
 | 
					summary_df.to_excel(output_path, index=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					print(f"统计结果已保存为 Excel 文件:{output_path}")
 | 
				
			||||||
							
								
								
									
										2
									
								
								查看进度.py
								
								
								
								
							
							
						
						| 
						 | 
					@ -46,7 +46,7 @@ def visualize_progress():
 | 
				
			||||||
        ax.text(i, v + 0.5, str(v), ha='center', fontsize=12)
 | 
					        ax.text(i, v + 0.5, str(v), ha='center', fontsize=12)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # 刷新绘图
 | 
					    # 刷新绘图
 | 
				
			||||||
    plt.pause(3)  # 暂停一段时间以更新图表
 | 
					    plt.pause(0)  # 暂停一段时间以更新图表
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 关闭窗口时,停止交互模式
 | 
					# 关闭窗口时,停止交互模式
 | 
				
			||||||
# plt.ioff()
 | 
					# plt.ioff()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,115 @@
 | 
				
			||||||
 | 
					import pickle
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import pandas as pd
 | 
				
			||||||
 | 
					import networkx as nx
 | 
				
			||||||
 | 
					import matplotlib.pyplot as plt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 1. 读取并处理数据
 | 
				
			||||||
 | 
					bom_nodes = pd.read_csv('input_data/input_product_data/BomNodes.csv')
 | 
				
			||||||
 | 
					bom_nodes['Code'] = bom_nodes['Code'].astype(str)
 | 
				
			||||||
 | 
					bom_nodes.set_index('Index', inplace=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bom_cate_net = pd.read_csv('input_data/input_product_data/合成结点.csv')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 2. 构建图结构
 | 
				
			||||||
 | 
					g_bom = nx.from_pandas_edgelist(bom_cate_net, source='UPID', target='ID', create_using=nx.MultiDiGraph())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 填充每一个结点的具体内容
 | 
				
			||||||
 | 
					bom_labels_dict = {}
 | 
				
			||||||
 | 
					for index in g_bom.nodes:
 | 
				
			||||||
 | 
					    try:
 | 
				
			||||||
 | 
					        bom_labels_dict[index] = bom_nodes.loc[index].to_dict()
 | 
				
			||||||
 | 
					    except KeyError:
 | 
				
			||||||
 | 
					        print(f"节点 {index} 不存在于 bom_nodes 中")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 分配属性给每一个结点
 | 
				
			||||||
 | 
					nx.set_node_attributes(g_bom, bom_labels_dict)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 3. 计算每个节点的度数
 | 
				
			||||||
 | 
					degrees = dict(g_bom.degree())  # 总度数(适用于有向图)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 4. 统计每个度数的节点数量
 | 
				
			||||||
 | 
					degree_counts = {}
 | 
				
			||||||
 | 
					for degree in degrees.values():
 | 
				
			||||||
 | 
					    if degree in degree_counts:
 | 
				
			||||||
 | 
					        degree_counts[degree] += 1
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        degree_counts[degree] = 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 转换为排序后的列表(横坐标:度数,纵坐标:节点数)
 | 
				
			||||||
 | 
					sorted_degrees = sorted(degree_counts.keys())
 | 
				
			||||||
 | 
					sorted_counts = [degree_counts[d] for d in sorted_degrees]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 5. 绘制度分布图
 | 
				
			||||||
 | 
					plt.figure(figsize=(12, 8))  # 增大画布尺寸
 | 
				
			||||||
 | 
					bars = plt.bar(sorted_degrees, sorted_counts, width=0.8)
 | 
				
			||||||
 | 
					plt.title('Degree Distribution In Industrial Chain', fontsize=16)
 | 
				
			||||||
 | 
					plt.xlabel('Degree', fontsize=14)
 | 
				
			||||||
 | 
					plt.ylabel('Number of Nodes', fontsize=14)
 | 
				
			||||||
 | 
					plt.grid(True, linestyle='--', alpha=0.5)
 | 
				
			||||||
 | 
					plt.xticks(rotation=45)  # 如果度数较多,可以旋转x轴标签
 | 
				
			||||||
 | 
					plt.tight_layout()  # 防止标签重叠
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 6. 在每个柱子上方标注数值
 | 
				
			||||||
 | 
					for bar in bars:
 | 
				
			||||||
 | 
					    height = bar.get_height()
 | 
				
			||||||
 | 
					    plt.text(
 | 
				
			||||||
 | 
					        bar.get_x() + bar.get_width() / 2,  # x坐标:柱子中心
 | 
				
			||||||
 | 
					        height + max(sorted_counts) * 0.02,  # y坐标:柱子顶部上方(留出空间)
 | 
				
			||||||
 | 
					        f'{int(height)}',  # 显示数值(转换为整数)
 | 
				
			||||||
 | 
					        ha='center',  # 水平居中
 | 
				
			||||||
 | 
					        va='bottom',  # 垂直底部对齐
 | 
				
			||||||
 | 
					        fontsize=10,  # 字体大小
 | 
				
			||||||
 | 
					        color='black'  # 字体颜色
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 7. 保存超高清图片(300 DPI)
 | 
				
			||||||
 | 
					output_path = "degree_distribution_with_labels.png"  # 输出文件名
 | 
				
			||||||
 | 
					plt.savefig(output_path, dpi=500, bbox_inches='tight')  # dpi=300 确保高分辨率
 | 
				
			||||||
 | 
					print(f"图片已保存至: {output_path}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 1. 加载企业网络数据
 | 
				
			||||||
 | 
					with open("firm_network.pkl", 'rb') as f:
 | 
				
			||||||
 | 
					    G_firm = pickle.load(f)
 | 
				
			||||||
 | 
					print(f"Successfully loaded cached data from firm_network.pkl")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 2. 计算企业网络的度分布
 | 
				
			||||||
 | 
					degrees_firm = dict(G_firm.degree())  # 总度数
 | 
				
			||||||
 | 
					degree_counts_firm = {}
 | 
				
			||||||
 | 
					for degree in degrees_firm.values():
 | 
				
			||||||
 | 
					    if degree in degree_counts_firm:
 | 
				
			||||||
 | 
					        degree_counts_firm[degree] += 1
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        degree_counts_firm[degree] = 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 转换为排序后的列表
 | 
				
			||||||
 | 
					sorted_degrees_firm = sorted(degree_counts_firm.keys())
 | 
				
			||||||
 | 
					sorted_counts_firm = [degree_counts_firm[d] for d in sorted_degrees_firm]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 3. 绘制企业网络的度分布图
 | 
				
			||||||
 | 
					plt.figure(figsize=(12, 6))  # 单独画布尺寸
 | 
				
			||||||
 | 
					plt.bar(sorted_degrees_firm, sorted_counts_firm, width=0.8)
 | 
				
			||||||
 | 
					plt.title('Degree Distribution of Firm Network', fontsize=16)
 | 
				
			||||||
 | 
					plt.xlabel('Degree (Number of Connections)', fontsize=14)
 | 
				
			||||||
 | 
					plt.ylabel('Number of Firms', fontsize=14)
 | 
				
			||||||
 | 
					plt.grid(True, linestyle='--', alpha=0.5)
 | 
				
			||||||
 | 
					plt.xticks(rotation=45)
 | 
				
			||||||
 | 
					plt.tight_layout()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 在柱子上方标注数值
 | 
				
			||||||
 | 
					for bar in plt.gca().containers[0]:  # 获取当前图中的柱子对象
 | 
				
			||||||
 | 
					    height = bar.get_height()
 | 
				
			||||||
 | 
					    plt.text(
 | 
				
			||||||
 | 
					        bar.get_x() + bar.get_width() / 2,
 | 
				
			||||||
 | 
					        height + max(sorted_counts_firm) * 0.02,
 | 
				
			||||||
 | 
					        f'{int(height)}',
 | 
				
			||||||
 | 
					        ha='center',
 | 
				
			||||||
 | 
					        va='bottom',
 | 
				
			||||||
 | 
					        fontsize=10,
 | 
				
			||||||
 | 
					        color='black'
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 保存图片
 | 
				
			||||||
 | 
					plt.savefig("degree_distribution_firm.png", dpi=500, bbox_inches='tight')
 | 
				
			||||||
 | 
					print("企业度分布图已保存至: degree_distribution_firm.png")
 | 
				
			||||||
 | 
					
 | 
				
			||||||