当前位置:网站首页>[learning notes] connectivity and circuit of graph
[learning notes] connectivity and circuit of graph
2022-07-05 14:18:00 【Ants looking up at the starry sky】
Graph Subset Problem
The first step is to delete something wonderful .
If the degree of a point < K-1 Then obviously it will not contribute to the answer , It can be deleted by a process similar to topological sorting .
If the degree <= K-1 There are some words left after deleting the dot of , Can solve case 1 .
The size of this question is K The regiment is not easy to find .
My initial practice withered
Consider deleting degrees = K-1 Judge whether this point is in a group .
direct O ( K 2 ) O(K^2) O(K2) Whether enumeration has two sides .
A little calculation will find the time complexity O ( m m log n ) O(m\sqrt{m}\log n) O(mmlogn) .
details : When a point is out of line, delete the point and its adjacent edges , Pay attention to one point. Don't join the team for many times .
Tanya and Password
Take it apart and you will find that this problem is asking you to ask Euler .
You can simulate with stack , After considering a point of immobility , Put this path in reverse order into the answer .
details : Pay attention to judge the connectivity of the graph , Because it is a directed graph, it is convenient to check the length of the final sequence .
We must judge the degree of nodes first
Data Center Drama
Can't
At first, I was wrong .
In fact, it's easy to think of Euler's circuit when you see the limit that the out and in degrees are even .
The problem is that the Euler loop guarantees the output = The degree of , There is no guarantee that the access is even .
Consider inverting even edges in Euler circuits , In this way, except for the end point, the points on the path must meet the limit .
Finally, determine the total number of edges , If it is an odd number, connect a self ring at the starting point .
边栏推荐
- Discussion on memset assignment
- 为什么我认识的机械工程师都抱怨工资低?
- How to call the function mode of one hand and one machine
- 家用电器行业商业供应链协同平台解决方案:供应链系统管理精益化,助推企业智造升级
- The function of qualifier in C language
- Hongmeng fourth training
- What are the advantages and characteristics of SAS interface
- ASP. Net large takeout ordering system source code (PC version + mobile version + merchant version)
- Lepton 无损压缩原理及性能分析
- Detailed explanation of SSH password free login
猜你喜欢
为什么我认识的机械工程师都抱怨工资低?
周大福践行「百周年承诺」,真诚服务推动绿色环保
Getting started with rce
SAS接口有什么优势特点
Tdengine biweekly selection of community issues | phase III
软件测试人在深圳有哪些值得去的互联网公司【软件测试人员专供版】
Thymeleaf 模板的创建与使用
非技术部门,如何参与 DevOps?
What category does the Internet of things application technology major belong to
TiFlash 源码解读(四) | TiFlash DDL 模块设计及实现分析
随机推荐
Don't be unconvinced. Mobile phone function upgrade is strong
基于 TiDB 场景式技术架构过程 - 理论篇
How to deeply understand the design idea of "finite state machine"?
Introduction, installation, introduction and detailed introduction to postman!
ASP. Net large takeout ordering system source code (PC version + mobile version + merchant version)
Simple process of penetration test
怎么叫一手一机的功能方式
IP packet header analysis and static routing
Discussion on memset assignment
Current situation, trend and view of neural network Internet of things in the future
Sorter evolution of ticdc 6.0 principle
VC development of non MFC program memory leak tracking code
MySQL user-defined function ID number to age (supports 15 / 18 digit ID card)
无密码身份验证如何保障用户隐私安全?
区间 - 左闭右开
3W principle [easy to understand]
POI set the data format of the column (valid)
The speed monitoring chip based on Bernoulli principle can be used for natural gas pipeline leakage detection
03_Solr之dataimport
R language ggplot2 visual density map: Visual density map by group and custom configuration geom_ The alpha parameter in the density function sets the image transparency (to prevent multiple density c