1. Introduction

   Define a closure of a directed graph \(G=(V,E)\) as an induced set of vertexes of \(G\), where the out-tended edges in \(E\) start at some vertex in the closure of \(G\) and end at some vertex in the closure, too. More formally, closure is defined as a set of vertexes \(V'\subseteq V\), such that \(\forall u\in V',s.t.\forall\left<u,v\right>\in E,v\in V'\).

   For the Maximum Weight Closure of a Graph, we define it as, with starting out endowing vertexes in \(V'\) costs called \(w_u\), the maximum value of \(\sum\limits_{u\in V'}w_u\).

2. Construction of Algorithm

   Add a source \(s\) and a sink \(t\) to the original graph, endow the origin edges in \(E\) with capacities that \(+\infty\), and connect \(s\) with points with positive costs with the points' costs as capacities on them while \(t\) connects to those with negative costs with the minus points' costs as capacities on them, where \(+\infty\) is defined as any number greater or equal to \(\sum |w_i|\).

   More formally, as explained & illustrated:

\[V_N=V\cup\{s,t\} \\
E_N=E\cup\left\{\left<s,v\right>\mid v\in V,w_v\geqslant0\right\}\cup\left\{\left<v,t\right>\mid v\in V,w_v<0\right\} \\
\begin{cases}
c(u,v)=+\infty,\left<u,v\right>\in E \\
\displaystyle
c(s,v)=w_v,w_v\geqslant0 \\
\displaystyle
c(v,t)=-w_v,w_v<0
\end{cases}
\]

   Which make it easy to understand the answer would be \(\text{min-cut}(G_N=\{V_N,E_N\})\).


[1] Referenced to 最小割模型在信息学竞赛中的应用 by 胡伯涛 Amber.

小札 Maximum Weight Closure of a Graph的更多相关文章

  1. CF1249F Maximum Weight Subset

    CF1249F Maximum Weight Subset 洛谷评测传送门 题目描述 You are given a tree, which consists of nn vertices. Reca ...

  2. Codeforces 1249F Maximum Weight Subset (贪心)

    题意 在一颗有点权的树上,选若干个点,使得这些点两两距离大于k,且点权和最大 思路 贪心的取比较大的值即可 将所有点按照深度从大到小排序,如果当前点点权\(a[i]\)大于0,则将距离为k以内的所有点 ...

  3. PC端一些非经典兼容性问题小札

    IE10默认在input框中输入内容后会显示一个‘X’按钮,方便删除输入的所有内容. 在password输入框显示一个眼睛的按钮,去掉叉叉和眼睛的方法如下: ::-ms-clear { display ...

  4. Python小札

    在Python中,等号(=)是赋值语句,可以把任意数据类型赋值给变量,同一个变量可以反复赋值,而且可以是不同类型的变量如: a = 123 #a是整数 print(a) a = 'ABC' #a变为字 ...

  5. codeforces#1249F. Maximum Weight Subset(树上dp)

    题目链接: http://codeforces.com/contest/1249/problem/F 题意: 一棵树的每个节点有个权值,选择一个节点集,使得任意点对的距离大于$k$ 求最大节点集权值, ...

  6. Codeforces 1249 F. Maximum Weight Subset

    传送门 设 $f[x][i]$ 表示 $x$ 的子树中,离 $x$ 最近的选择的节点距离为 $i$ 的合法方案的最大价值 设 $val[x]$ 表示节点 $x$ 的价值,首先有 $f[x][0]=va ...

  7. 【CF1249F】Maximum Weight Subset(贪心)

    题意:给定一棵n个点带点权的树,要求从中选出一个点集,使得这些点两两之间距离都大于K,求最大点权和 n,K<=2e2,1<=a[i]<=1e5 思路:树形DP显然可做,极限是n方,然 ...

  8. F. Maximum Weight Subset(贪心or树形dp解法)

    题:https://codeforces.com/contest/1249/problem/F 题意:给一颗树,边权为1,节点有点权,问取到一个点集,俩俩之间路径超过k,是点权和最大 思路:贪心地取点 ...

  9. 2016 Multi-University Training Contest 9 solutions BY 金策工业综合大学

    A Poor King Tag: Reversed BFS Preprocessing is needed to calculate answers for all positions (states ...

  10. CF1082D:Maximum Diameter Graph (简单构造)

    Graph constructive problems are back! This time the graph you are asked to build should match the fo ...

随机推荐

  1. WPF入门教程系列二十七 ——DataGrid使用示例MVVM模式(4)

    WPF入门教程系列目录 WPF入门教程系列二--Application介绍 WPF入门教程系列三--Application介绍(续) WPF入门教程系列四--Dispatcher介绍 WPF入门教程系 ...

  2. 发现了阿里云 APP 的一个小 BUG

    由于微信不允许外部链接,你需要点击文章尾部左下角的 "阅读原文",才能访问文中链接. 前几天在华为手机上使用阿里云 APP,从 oss bucket 中下载了一张图片,想要通过微信 ...

  3. 20200630 excel365 选中一个单元格,对应的行和列都高亮

    Excel默认只高亮选中单元格的行标和列标,在整理数据时容易眼花,如能把这一行和列都高亮岂不是更好.方法在此: 1 打开"开发工具"菜单 默认这一项是隐藏的.文件-选项-自定义功能 ...

  4. Prompt 手册——gpt-best-practices

    本文链接:https://www.cnblogs.com/wanger-sjtu/p/17470388.html 本文是 OpenAI gpt-best-practices 对如何使用GPT的Prom ...

  5. 一篇讲懂Java运行类型、编译类型和多态(面向对象语言精髓之一)

    对象:运行类型.编译类型和多态 1.搞清楚面向对象的运行类型和编译类型就掌握了对象的精髓,我们用举个例子 class Father { Father() { System.out.println(&q ...

  6. 精选8道ES高频面试题和答案,后悔没早点看。

    不要再干巴巴的背诵八股文了,一定要结合具体场景回答面试问题! 前言 我们在回答面试题的时候,不能干巴巴的去背八股文,一定要结合应用场景,最好能结合过去做过的项目,去和面试官沟通. 这些场景题虽然不要求 ...

  7. Java 网络编程 —— 安全网络通信

    SSL 简介 SSL(Secure Socket Layer,安全套接字层)是一种保证网络上的两个节点进行安全通信的协议.IETF(Interet Engineering Task Force)国际组 ...

  8. 自研ORM (匠心之作)

    Fast Framework 作者 Mr-zhong 代码改变世界.... 一.前言 Fast Framework 基于NET6.0 封装的轻量级 ORM 框架 支持多种数据库 SqlServer O ...

  9. "Process finished with exit code 1" 进程结束

    问题描述 :  springboot     程序运行出现以下情况 没有错误日志  返回运行结束 状态码  1     状态码为 1 的时候表示程序不是异常终止 连接到目标VM, 地址: ''127. ...

  10. 虚拟化学习:vps和云计算的区别

    1 vps 可以由虚拟机实现,但并不是虚拟机; 虚拟机是云计算的核心,但虚拟机也不等于云主机. 2 vps是面向单台服务器的虚拟化技术,服务器挂了,其上的vps也跟着挂了. 3 云计算是面向服务器集群 ...