/usr/include/boost/graph
NameSizeModeActions
detail/-0755rm
distributed/-0755rm
parallel/-0755rm
planar_detail/-0755rm
property_maps/-0755rm
accounting.hpp8760644editdlrm
adjacency_iterator.hpp28990644editdlrm
adjacency_list.hpp136920644editdlrm
adjacency_list_io.hpp118490644editdlrm
adjacency_matrix.hpp457430644editdlrm
adj_list_serialize.hpp45230644editdlrm
astar_search.hpp267360644editdlrm
bandwidth.hpp29920644editdlrm
bc_clustering.hpp59370644editdlrm
bellman_ford_shortest_paths.hpp82290644editdlrm
betweenness_centrality.hpp262900644editdlrm
biconnected_components.hpp167010644editdlrm
bipartite.hpp134920644editdlrm
boyer_myrvold_planar_test.hpp98490644editdlrm
boykov_kolmogorov_max_flow.hpp473420644editdlrm
breadth_first_search.hpp147510644editdlrm
bron_kerbosch_all_cliques.hpp117360644editdlrm
buffer_concepts.hpp24290644editdlrm
chrobak_payne_drawing.hpp86410644editdlrm
circle_layout.hpp19240644editdlrm
closeness_centrality.hpp60570644editdlrm
clustering_coefficient.hpp57260644editdlrm
compressed_sparse_row_graph.hpp698870644editdlrm
connected_components.hpp41340644editdlrm
copy.hpp212250644editdlrm
core_numbers.hpp136630644editdlrm
create_condensation_graph.hpp31590644editdlrm
cuthill_mckee_ordering.hpp59920644editdlrm
cycle_canceling.hpp66450644editdlrm
dag_shortest_paths.hpp60640644editdlrm
degree_centrality.hpp42360644editdlrm
depth_first_search.hpp154300644editdlrm
dijkstra_shortest_paths.hpp236870644editdlrm
dijkstra_shortest_paths_no_color_map.hpp96200644editdlrm
dimacs.hpp104480644editdlrm
directed_graph.hpp242140644editdlrm
dll_import_export.hpp8920644editdlrm
dominator_tree.hpp175530644editdlrm
eccentricity.hpp46110644editdlrm
edge_coloring.hpp68090644editdlrm
edge_connectivity.hpp67960644editdlrm
edge_list.hpp99480644editdlrm
edmonds_karp_max_flow.hpp101770644editdlrm
edmunds_karp_max_flow.hpp9820644editdlrm
erdos_renyi_generator.hpp72570644editdlrm
exception.hpp14660644editdlrm
exterior_property.hpp42890644editdlrm
filtered_graph.hpp200980644editdlrm
find_flow_cost.hpp18590644editdlrm
floyd_warshall_shortest.hpp85100644editdlrm
fruchterman_reingold.hpp173250644editdlrm
geodesic_distance.hpp80150644editdlrm
graphml.hpp134600644editdlrm
graphviz.hpp335030644editdlrm
graph_archetypes.hpp110080644editdlrm
graph_as_tree.hpp45320644editdlrm
graph_concepts.hpp197850644editdlrm
graph_mutability_traits.hpp49950644editdlrm
graph_selectors.hpp12740644editdlrm
graph_stats.hpp43940644editdlrm
graph_traits.hpp130650644editdlrm
graph_utility.hpp161820644editdlrm
grid_graph.hpp338300644editdlrm
gursoy_atun_layout.hpp132480644editdlrm
hawick_circuits.hpp145930644editdlrm
howard_cycle_ratio.hpp231070644editdlrm
incremental_components.hpp82240644editdlrm
isomorphism.hpp263080644editdlrm
is_kuratowski_subgraph.hpp102600644editdlrm
is_straight_line_drawing.hpp72300644editdlrm
iteration_macros.hpp116590644editdlrm
iteration_macros_undef.hpp6730644editdlrm
johnson_all_pairs_shortest.hpp76460644editdlrm
kamada_kawai_spring_layout.hpp280480644editdlrm
king_ordering.hpp121010644editdlrm
kruskal_min_spanning_tree.hpp57430644editdlrm
labeled_graph.hpp309140644editdlrm
leda_graph.hpp287890644editdlrm
lookup_edge.hpp18940644editdlrm
loop_erased_random_walk.hpp44360644editdlrm
make_biconnected_planar.hpp35130644editdlrm
make_connected.hpp26450644editdlrm
make_maximal_planar.hpp75780644editdlrm
matrix_as_graph.hpp72270644editdlrm
maximum_adjacency_search.hpp151250644editdlrm
maximum_weighted_matching.hpp497220644editdlrm
max_cardinality_matching.hpp310000644editdlrm
mcgregor_common_subgraphs.hpp434700644editdlrm
mesh_graph_generator.hpp56160644editdlrm
metis.hpp109820644editdlrm
metric_tsp_approx.hpp108090644editdlrm
minimum_degree_ordering.hpp270870644editdlrm
named_function_params.hpp396390644editdlrm
named_graph.hpp206140644editdlrm
neighbor_bfs.hpp117630644editdlrm
numeric_values.hpp18140644editdlrm
one_bit_color_map.hpp32770644editdlrm
overloading.hpp15840644editdlrm
page_rank.hpp61640644editdlrm
planar_canonical_ordering.hpp72030644editdlrm
planar_face_traversal.hpp60200644editdlrm
plod_generator.hpp77080644editdlrm
point_traits.hpp7820644editdlrm
prim_minimum_spanning_tree.hpp29600644editdlrm
profile.hpp13270644editdlrm
properties.hpp124170644editdlrm
property_iter_range.hpp43450644editdlrm
push_relabel_max_flow.hpp347370644editdlrm
random.hpp96720644editdlrm
random_layout.hpp9880644editdlrm
random_spanning_tree.hpp57750644editdlrm
read_dimacs.hpp120800644editdlrm
relax.hpp44000644editdlrm
reverse_graph.hpp224020644editdlrm
rmat_graph_generator.hpp192910644editdlrm
r_c_shortest_paths.hpp306730644editdlrm
sequential_vertex_coloring.hpp45620644editdlrm
simple_point.hpp6280644editdlrm
sloan_ordering.hpp155400644editdlrm
smallest_last_ordering.hpp54580644editdlrm
small_world_generator.hpp36700644editdlrm
ssca_graph_generator.hpp65640644editdlrm
stanford_graph.hpp201260644editdlrm
stoer_wagner_min_cut.hpp124150644editdlrm
strong_components.hpp130090644editdlrm
st_connected.hpp28520644editdlrm
subgraph.hpp399960644editdlrm
successive_shortest_path_nonnegative_weights.hpp104130644editdlrm
tiernan_all_cycles.hpp125470644editdlrm
topological_sort.hpp26110644editdlrm
topology.hpp203890644editdlrm
transitive_closure.hpp142600644editdlrm
transitive_reduction.hpp53260644editdlrm
transpose_graph.hpp11980644editdlrm
tree_traits.hpp13380644editdlrm
two_bit_color_map.hpp35100644editdlrm
two_graphs_common_spanning_trees.hpp349960644editdlrm
undirected_dfs.hpp106720644editdlrm
undirected_graph.hpp252760644editdlrm
use_mpi.hpp4370644editdlrm
vector_as_graph.hpp104740644editdlrm
vertex_and_edge_range.hpp55280644editdlrm
vf2_sub_graph_iso.hpp485850644editdlrm
visitors.hpp113180644editdlrm
wavefront.hpp39320644editdlrm
write_dimacs.hpp28890644editdlrm
Edit: /usr/include/boost/graph/chrobak_payne_drawing.hpp (8641B)
//======================================================================= // Copyright (c) Aaron Windsor 2007 // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= #ifndef __CHROBAK_PAYNE_DRAWING_HPP__ #define __CHROBAK_PAYNE_DRAWING_HPP__ #include #include #include #include #include #include namespace boost { namespace graph { namespace detail { template < typename Graph, typename VertexToVertexMap, typename VertexTo1DCoordMap > void accumulate_offsets( typename graph_traits< Graph >::vertex_descriptor v, std::size_t offset, const Graph& g, VertexTo1DCoordMap x, VertexTo1DCoordMap delta_x, VertexToVertexMap left, VertexToVertexMap right) { typedef typename graph_traits< Graph >::vertex_descriptor vertex_descriptor; // Suggestion of explicit stack from Aaron Windsor to avoid system // stack overflows. typedef std::pair< vertex_descriptor, std::size_t > stack_entry; std::stack< stack_entry > st; st.push(stack_entry(v, offset)); while (!st.empty()) { vertex_descriptor v = st.top().first; std::size_t offset = st.top().second; st.pop(); if (v != graph_traits< Graph >::null_vertex()) { x[v] += delta_x[v] + offset; st.push(stack_entry(left[v], x[v])); st.push(stack_entry(right[v], x[v])); } } } } /*namespace detail*/ } /*namespace graph*/ template < typename Graph, typename PlanarEmbedding, typename ForwardIterator, typename GridPositionMap, typename VertexIndexMap > void chrobak_payne_straight_line_drawing(const Graph& g, PlanarEmbedding embedding, ForwardIterator ordering_begin, ForwardIterator ordering_end, GridPositionMap drawing, VertexIndexMap vm) { typedef typename graph_traits< Graph >::vertex_descriptor vertex_t; typedef typename graph_traits< Graph >::vertex_iterator vertex_iterator_t; typedef typename PlanarEmbedding::value_type::const_iterator edge_permutation_iterator_t; typedef typename graph_traits< Graph >::vertices_size_type v_size_t; typedef std::vector< vertex_t > vertex_vector_t; typedef std::vector< v_size_t > vsize_vector_t; typedef std::vector< bool > bool_vector_t; typedef boost::iterator_property_map< typename vertex_vector_t::iterator, VertexIndexMap > vertex_to_vertex_map_t; typedef boost::iterator_property_map< typename vsize_vector_t::iterator, VertexIndexMap > vertex_to_vsize_map_t; typedef boost::iterator_property_map< typename bool_vector_t::iterator, VertexIndexMap > vertex_to_bool_map_t; vertex_vector_t left_vector( num_vertices(g), graph_traits< Graph >::null_vertex()); vertex_vector_t right_vector( num_vertices(g), graph_traits< Graph >::null_vertex()); vsize_vector_t seen_as_right_vector(num_vertices(g), 0); vsize_vector_t seen_vector(num_vertices(g), 0); vsize_vector_t delta_x_vector(num_vertices(g), 0); vsize_vector_t y_vector(num_vertices(g)); vsize_vector_t x_vector(num_vertices(g), 0); bool_vector_t installed_vector(num_vertices(g), false); vertex_to_vertex_map_t left(left_vector.begin(), vm); vertex_to_vertex_map_t right(right_vector.begin(), vm); vertex_to_vsize_map_t seen_as_right(seen_as_right_vector.begin(), vm); vertex_to_vsize_map_t seen(seen_vector.begin(), vm); vertex_to_vsize_map_t delta_x(delta_x_vector.begin(), vm); vertex_to_vsize_map_t y(y_vector.begin(), vm); vertex_to_vsize_map_t x(x_vector.begin(), vm); vertex_to_bool_map_t installed(installed_vector.begin(), vm); v_size_t timestamp = 1; vertex_vector_t installed_neighbors; ForwardIterator itr = ordering_begin; vertex_t v1 = *itr; ++itr; vertex_t v2 = *itr; ++itr; vertex_t v3 = *itr; ++itr; delta_x[v2] = 1; delta_x[v3] = 1; y[v1] = 0; y[v2] = 0; y[v3] = 1; right[v1] = v3; right[v3] = v2; installed[v1] = installed[v2] = installed[v3] = true; for (ForwardIterator itr_end = ordering_end; itr != itr_end; ++itr) { vertex_t v = *itr; // First, find the leftmost and rightmost neighbor of v on the outer // cycle of the embedding. // Note: since we're moving clockwise through the edges adjacent to v, // we're actually moving from right to left among v's neighbors on the // outer face (since v will be installed above them all) looking for // the leftmost and rightmost installed neigbhors vertex_t leftmost = graph_traits< Graph >::null_vertex(); vertex_t rightmost = graph_traits< Graph >::null_vertex(); installed_neighbors.clear(); vertex_t prev_vertex = graph_traits< Graph >::null_vertex(); edge_permutation_iterator_t pi, pi_end; pi_end = embedding[v].end(); for (pi = embedding[v].begin(); pi != pi_end; ++pi) { vertex_t curr_vertex = source(*pi, g) == v ? target(*pi, g) : source(*pi, g); // Skip any self-loops or parallel edges if (curr_vertex == v || curr_vertex == prev_vertex) continue; if (installed[curr_vertex]) { seen[curr_vertex] = timestamp; if (right[curr_vertex] != graph_traits< Graph >::null_vertex()) { seen_as_right[right[curr_vertex]] = timestamp; } installed_neighbors.push_back(curr_vertex); } prev_vertex = curr_vertex; } typename vertex_vector_t::iterator vi, vi_end; vi_end = installed_neighbors.end(); for (vi = installed_neighbors.begin(); vi != vi_end; ++vi) { if (right[*vi] == graph_traits< Graph >::null_vertex() || seen[right[*vi]] != timestamp) rightmost = *vi; if (seen_as_right[*vi] != timestamp) leftmost = *vi; } ++timestamp; // stretch gaps ++delta_x[right[leftmost]]; ++delta_x[rightmost]; // adjust offsets std::size_t delta_p_q = 0; vertex_t stopping_vertex = right[rightmost]; for (vertex_t temp = right[leftmost]; temp != stopping_vertex; temp = right[temp]) { delta_p_q += delta_x[temp]; } delta_x[v] = ((y[rightmost] + delta_p_q) - y[leftmost]) / 2; y[v] = y[leftmost] + delta_x[v]; delta_x[rightmost] = delta_p_q - delta_x[v]; bool leftmost_and_rightmost_adjacent = right[leftmost] == rightmost; if (!leftmost_and_rightmost_adjacent) delta_x[right[leftmost]] -= delta_x[v]; // install v if (!leftmost_and_rightmost_adjacent) { left[v] = right[leftmost]; vertex_t next_to_rightmost; for (vertex_t temp = leftmost; temp != rightmost; temp = right[temp]) { next_to_rightmost = temp; } right[next_to_rightmost] = graph_traits< Graph >::null_vertex(); } else { left[v] = graph_traits< Graph >::null_vertex(); } right[leftmost] = v; right[v] = rightmost; installed[v] = true; } graph::detail::accumulate_offsets( *ordering_begin, 0, g, x, delta_x, left, right); vertex_iterator_t vi, vi_end; for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) { vertex_t v(*vi); drawing[v].x = x[v]; drawing[v].y = y[v]; } } template < typename Graph, typename PlanarEmbedding, typename ForwardIterator, typename GridPositionMap > inline void chrobak_payne_straight_line_drawing(const Graph& g, PlanarEmbedding embedding, ForwardIterator ord_begin, ForwardIterator ord_end, GridPositionMap drawing) { chrobak_payne_straight_line_drawing( g, embedding, ord_begin, ord_end, drawing, get(vertex_index, g)); } } // namespace boost #endif //__CHROBAK_PAYNE_DRAWING_HPP__