当前位置:网站首页>[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 .
边栏推荐
猜你喜欢
物联网应用技术专业是属于什么类
软件测试人在深圳有哪些值得去的互联网公司【软件测试人员专供版】
Scenario based technology architecture process based on tidb - Theory
How can non-technical departments participate in Devops?
Why do mechanical engineers I know complain about low wages?
金融壹賬通香港上市:市值63億港元 葉望春稱守正篤實,久久為功
Thymeleaf th:classappend属性追加 th:styleappend样式追加 th:data-自定义属性
Financial one account Hong Kong listed: market value of 6.3 billion HK $Ye wangchun said to be Keeping true and true, long - term work
为什么我认识的机械工程师都抱怨工资低?
区间 - 左闭右开
随机推荐
世界环境日 | 周大福用心服务推动减碳环保
Implementation process of WSDL and soap calls under PHP5
The forked VM terminated without saying properly goodbye
Mysql database installation tutorial under Linux
Enjoy what you want. Zhichuang future
3W原则[通俗易懂]
R语言ggplot2可视化:gganimate包基于transition_time函数创建动态散点图动画(gif)、使用shadow_mark函数为动画添加静态散点图作为动画背景
Judge whether the variable is an array
R语言dplyr包select函数、group_by函数、mutate函数、cumsum函数计算dataframe分组数据中指定数值变量的累加值、并生成累加数据列
Hongmeng fourth training
家用电器行业商业供应链协同平台解决方案:供应链系统管理精益化,助推企业智造升级
Which Internet companies are worth going to in Shenzhen for software testers [Special Edition for software testers]
周大福践行「百周年承诺」,真诚服务推动绿色环保
关于memset赋值的探讨
01. Solr7.3.1 deployment and configuration of jetty under win10 platform
SSH免密码登录详解
What are the advantages and characteristics of SAS interface
Detailed explanation of SSH password free login
openGauss数据库源码解析系列文章—— 密态等值查询技术详解(下)
R语言ggplot2可视化密度图:按照分组可视化密度图、自定义配置geom_density函数中的alpha参数设置图像透明度(防止多条密度曲线互相遮挡)