for (unsigned int j = 0; j < vector_active (adj->to); j++)
if (vector_slot (adj->to, j) == node)
vector_unset (adj->to, j);
-
- // if the node is orphaned, delete it
- if (vector_active (adj->to) == 0 &&
- vector_active (adj->from) == 0 &&
- adj != node)
- graph_delete_node (graph, adj);
}
// for all nodes that we have an edge to, remove us from their ->from
for (unsigned int j = 0; j < vector_active (adj->from); j++)
if (vector_slot (adj->from, j) == node)
vector_unset (adj->from, j);
-
- // if the node is orphaned, delete it
- if (vector_active (adj->to) == 0 &&
- vector_active (adj->from) == 0 &&
- adj != node)
- graph_delete_node (graph, adj);
}
- // if there is a deletion callback, call it!
+ // if there is a deletion callback, call it
if (node->del && node->data)
(*node->del) (node->data);
* Before deletion, this function removes all edges to and from this node from
* any neighbor nodes.
*
- * If, as a result of this operation, any neighbor node has no edges either to
- * or from itself, that node will be deleted as well. If the graph topology is
- * e.g. a star this will result in the deletion of all nodes.
- *
* If *data and *del are non-null, the following call is made:
* (*node->del) (node->data);
*