GraphNeighbors
Description
Adjacency list for a single graph node.
Each item is a GraphNodeId referring to another live node. Graph uses this same vector shape for both outgoing and incoming adjacency storage.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Graph.c:196:
}
static bool graph_neighbors_contains(const GraphNeighbors *neighbors, GraphNodeId node_id) {
size idx;- In
Graph.c:208:
}
static size graph_find_neighbor_index(const GraphNeighbors *neighbors, GraphNodeId node_id) {
size idx;- In
Graph.c:235:
static bool graph_remove_edge_now(GenericGraph *graph, GraphNodeId from, GraphNodeId to) {
GraphNeighbors *out_neighbors;
GraphNeighbors *in_neighbors;
size out_idx;- In
Graph.c:236:
static bool graph_remove_edge_now(GenericGraph *graph, GraphNodeId from, GraphNodeId to) {
GraphNeighbors *out_neighbors;
GraphNeighbors *in_neighbors;
size out_idx;
size in_idx;- In
Graph.c:260:
static size graph_remove_marked_outgoing_edges(GenericGraph *graph, GraphNodeId from) {
size removed = 0;
GraphNeighbors *neighbors = graph_out_neighbors_ptr(graph, from);
size idx = 0;- In
Graph.c:286:
static size graph_remove_all_outgoing_edges(GenericGraph *graph, GraphNodeId from) {
size removed = 0;
GraphNeighbors *neighbors = graph_out_neighbors_ptr(graph, from);
while (VecLen(neighbors)) {- In
Graph.c:431:
const GraphPendingEdgeRemoval *pending =
VecPtrAt((GraphPendingEdgeRemovals *)&graph->pending_edge_removals, free_index_i);
const GraphNeighbors *neighbors;
graph_validate_node_id(graph, pending->from);- In
Graph.c:671:
}
GraphNeighbors *graph_out_neighbors_ptr(GenericGraph *graph, GraphNodeId node_id) {
return &graph_require_live_slot(graph, node_id)->out_neighbors;
}- In
Graph.c:675:
}
GraphNeighbors *graph_in_neighbors_ptr(GenericGraph *graph, GraphNodeId node_id) {
return &graph_require_live_slot(graph, node_id)->in_neighbors;
}- In
Graph.c:688:
GraphNodeId graph_neighbor_at(GenericGraph *graph, GraphNodeId from, size neighbor_idx) {
GraphNeighbors *neighbors;
ValidateGraph(graph);- In
Graph.c:702:
GraphNodeId graph_predecessor_at(GenericGraph *graph, GraphNodeId to, size predecessor_idx) {
GraphNeighbors *neighbors;
ValidateGraph(graph);- In
Graph.c:716:
bool graph_has_edge(GenericGraph *graph, GraphNodeId from, GraphNodeId to) {
GraphNeighbors *neighbors;
ValidateGraph(graph);- In
Graph.c:727:
bool graph_add_edge(GenericGraph *graph, GraphNodeId from, GraphNodeId to) {
GraphNeighbors *out_neighbors;
GraphNeighbors *in_neighbors;- In
Graph.c:728:
bool graph_add_edge(GenericGraph *graph, GraphNodeId from, GraphNodeId to) {
GraphNeighbors *out_neighbors;
GraphNeighbors *in_neighbors;
ValidateGraph(graph);- In
Graph.c:1008:
bool graph_neighbor_iter_next(GenericGraphNeighborIter *iter, GraphNode *out_node) {
GraphNeighbors *neighbors;
if (!iter || !out_node) {- In
Graph.c:1055:
bool graph_predecessor_iter_next(GenericGraphPredecessorIter *iter, GraphNode *out_node) {
GraphNeighbors *neighbors;
if (!iter || !out_node) {- In
Type.h:86:
///
typedef struct {
GraphNeighbors out_neighbors;
GraphNeighbors in_neighbors;
void *data;- In
Type.h:87:
typedef struct {
GraphNeighbors out_neighbors;
GraphNeighbors in_neighbors;
void *data;
u64 visit_count;- In
Type.h:107:
#define GraphSlot(T) \
struct { \
GraphNeighbors out_neighbors; \
GraphNeighbors in_neighbors; \
T *data; \- In
Type.h:108:
struct { \
GraphNeighbors out_neighbors; \
GraphNeighbors in_neighbors; \
T *data; \
u64 visit_count; \
Last updated on