}
-struct VertexIndexMap;
-
-namespace boost {
- struct property_traits<VertexIndexMap> {
- // Concept Readable Property Map:
- typedef int value_type, reference, key_type;
- category
-class Boost
- }};
-
-void single_source_shortest_paths(int v1,
- const double edge_weights[/*f*/],
- ) {
+static void single_source_shortest_paths(int v1,
+ const double edge_weights[/*f*/],
+ double vertex_distances[/*v*/]) {
boost::dijkstra_shortest_paths
(g, v1,
weight_map(edge_weights).
vertex_index_map(identity_property_map()).
-
+ distance_map(vertex_distances));
+}
-void all_pairs_shortest_paths(const Layout *g) {
-
+double graph_layout_energy(const Layout *g) {
+ /* For each (vi,vj) computes shortest path pij = vi..vj along edges,
+ * and actual distance dij = vi-vj.
+ *
+ * Energy contribution is proportional to
+ *
+ * pij - dij
+ * --------- . Sigma length
+ * 2 e member (edges(vi) union edges(vj) e
+ * dij
+ */
+ double edge_weights[N*V6], vertex_distances[N];
+ int v1, e, f;
+
+ FOR_VEDGE_X(v1,e,
+ f= v1 | e << ESHIFT,
+ edge_weights[f]= NaN)
+ edge_weights[f]= hypotD(g.v[v1], g.v[v2]);
+
FOR_VERTEX(v1) {
+ single_source_shortest_paths(v1, edge_weights, vertex_distances);
+ FOR_VERTEX(v2) {
+
+
+
+
+ { ) {
+
0);