#include <stdlib.h>
#include <math.h>
-int common_neighbors(vtx_data * graph, int v, int u, int *v_vector)
+int common_neighbors(vtx_data * graph, int u, int *v_vector)
{
- /* count number of common neighbors of 'v' and 'u' */
+ // count number of common neighbors of 'v_vector' and 'u'
int neighbor;
int num_shared_neighbors = 0;
int j;
neighbor = graph[i].edges[j];
deg_j = graph[neighbor].nedges - 1;
weights[j] =
- (float) (deg_i + deg_j -
- 2 * common_neighbors(graph, i, neighbor,
- vtx_vec));
+ (float)(deg_i + deg_j - 2 * common_neighbors(graph, neighbor, vtx_vec));
}
empty_neighbors_vec(graph, i, vtx_vec);
weights += graph[i].nedges;
extern void fill_neighbors_vec_unweighted(vtx_data *, int vtx,
int *vtx_vec);
- extern int common_neighbors(vtx_data *, int v, int u, int *);
+ extern int common_neighbors(vtx_data *, int u, int *);
extern void empty_neighbors_vec(vtx_data * graph, int vtx,
int *vtx_vec);
extern DistType **compute_apsp(vtx_data *, int);
neighbor = graph[i].edges[j];
deg_j = graph[neighbor].nedges - 1;
weights[j] = fmaxf((float)(deg_i + deg_j -
- 2 * common_neighbors(graph, i, neighbor, vtx_vec)), graph[i].ewgts[j]);
+ 2 * common_neighbors(graph, neighbor, vtx_vec)), graph[i].ewgts[j]);
}
empty_neighbors_vec(graph, i, vtx_vec);
graph[i].ewgts = weights;
neighbor = graph[i].edges[j];
deg_j = graph[neighbor].nedges - 1;
weights[j] =
- ((float) deg_i + deg_j -
- 2 * common_neighbors(graph, i, neighbor, vtx_vec));
+ ((float) deg_i + deg_j - 2 * common_neighbors(graph, neighbor, vtx_vec));
}
empty_neighbors_vec(graph, i, vtx_vec);
weights += graph[i].nedges;