我需要使用计算流量网络的最小成本最大流量
boost::successive_shortest_path_nonnegative_weights()
Run Code Online (Sandbox Code Playgroud)
BGL中可用的功能(v 1_60_0).如文档中所述,
表示网络的有向图G =(V,E)必须被扩充以包括用于在大肠杆菌中的每条边即,输入图形应杜松子酒=反向边缘(V,{EU ET}).[...] CapacityEdgeMap参数上限必须将E中的每个边缘映射到正数,并将ET中的每个边缘映射到0. WeightMap必须将每个边缘从E映射到非负数,并且每个边缘从ET到-weight的权重它的反转边缘.
我有一个简单的功能,对于添加到图表中的每个边缘,添加一个具有上述指定的容量和重量的反向边缘:
void add_edge_and_reverse(vertex_desc& source, vertex_desc& target, Edge& edge, flow_network_t& fn, boost::associative_property_map<std::map<edge_desc, edge_desc>>& rev_map)
{
std::pair<edge_desc, bool> e = boost::add_edge(source, target, edge, fn);
Edge reverse_edge(-edge.cost, 0);
std::pair<edge_desc, bool> e_rev = boost::add_edge(target, source, reverse_edge, fn);
rev_map[e.first] = e_rev.first;
rev_map[e_rev.first] = e.first;
}
Run Code Online (Sandbox Code Playgroud)
现在,图形包含反向边缘,它们具有负权重,这与我正在使用的算法的名称形成鲜明对比.因此,当我执行算法时,我收到此错误:
ValueError: The graph may not contain an edge with negative weight.
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
我正在尝试使用SQLPLUS中的SPOOL命令为数据库中的对象生成所有DDL
SET trimspool ON
SET wrap off
SET heading off
SET linesize 300
SET echo off
SET pages 999
SET long 90000
Col object_type format a10000
Col object_name format a10000
Col owner format a10000
spool export.out
SELECT DBMS_METADATA.GET_DDL(object_type, object_name, owner)
FROM all_OBJECTS
WHERE OWNER = 'DMALM'
and object_type not like '%PARTITION'
and object_type not like '%BODY'
and object_type not like '%LOB';
spool off
quit
Run Code Online (Sandbox Code Playgroud)
但我得到的输出文件是在col#80切割.如何防止输出文件被包装?