当前位置:网站首页>Poj1548 robots [bipartite graph minimum path coverage]
Poj1548 robots [bipartite graph minimum path coverage]
2022-07-27 13:04:00 【51CTO】
Topic link :
http://poj.org/problem?id=1548
The main idea of the topic :
In a N*M(N <= 24,M <= 24) The figure of , There's a lot of rubbish , The robot cleaning garbage starts from the upper left corner . has
Know that robots can only clean garbage right or down , After cleaning up the garbage in a place, you can continue to clean it right or down
Other Waste . Finally run to (N,M) The position of ends . ask : How many robots are needed at least , Can clean up all the garbage .
Ideas :
There is no N and M Size , It just gives the location of the garbage . For input 0 0 Indicates the end of a group of data input . Build a structure
Body to store the coordinate value of garbage . Now let's build a bipartite graph , On both sides of the graph are garbage nodes , Traversal primitive , If garbage j stay
The garbage i In the lower right corner , will (i,j) Add to the bipartite graph , Finally, the problem becomes : Find the minimum path cover of the bipartite graph . By two
Minimum path coverage of graph = points - Maximum matching of bipartite graph , The maximum matching of bipartite graph is obtained according to Hungarian algorithm , And then come to the conclusion .
AC Code :
边栏推荐
- 时间工具类,得到当前时间,date转string
- Baoli food listed on Shanghai Stock Exchange: annual revenue of 1.578 billion, market value of 5.8 billion
- 隔离级别
- US pressure surges tiktok changes global safety director
- The sparksubmit. Main () method submits external parameters and remotely submits the standalone cluster task
- PySide6/PyQt开发经验总结(2) - 设置快捷键
- BSP视频教程第21期:轻松一键实现串口DMA不定长收发,支持裸机和RTOS,含MDK和IAR两种玩法,比STM32CubeMX还方便(2022-07-24)
- 【表达式计算】双栈 : 表达式计算问题的通用解法
- Why does the class annotated with @configuration generate cglib proxy?
- P1321 word overlay restore [getting started]
猜你喜欢

How can the top 500 enterprises improve their R & D efficiency? Let's see what industry experts say!

Will causal learning open the next generation of AI? Chapter 9 Yunji datacanvas officially released the open source project of ylarn causal learning

Use redis' sorted set to make weekly hot reviews

Set interface

开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能

Openpyxl drawing area map

Baoli food listed on Shanghai Stock Exchange: annual revenue of 1.578 billion, market value of 5.8 billion

Is it easy to find a job after programmer training and learning

Zhongke Lanxun fell 30% on the first day of listing: Huang Zhiqiang, 60, started a company with a market value of 7.7 billion

An overview of kernel compilation system
随机推荐
Enjoy the luxury meta universe louis:the game, and participate in the NFT series digital collection white roll activity | tutorial
II. Analysis of the execution process of make menuconfig
HDU1698_ Just a Hook
「游戏引擎 浅入浅出」4.1 Unity Shader和OpenGL Shader
"Game engine light in light out" 4.1 unity shader and OpenGL shader
Error: the source of the existing CacheManager is: urlconfigurationsource
Play CSDN editor
程序员培训学习后好找工作吗
POJ2446 Chessboard【二分图最大匹配】
Detail throw and throws
延迟队列DelayQueue性能测试
Specify the add method of HashSet
Zhongke Lanxun fell 30% on the first day of listing: Huang Zhiqiang, 60, started a company with a market value of 7.7 billion
JS single thread understanding notes - Original
Set接口
SparkSubmit.main()方法提交外部参数,远程提交standalone集群任务
Set interface
4. Analysis of the execution process of make modules for general purposes
关于2022年3月9日之后Typora登录不了--已解决
Self built personalized automatic quotation system to cope with changeable quotation mode