@yaakovtayeb If you’re looking to start from a specific node and explore outwards you could take this and modify it. The depth would be how many neighbors of neighbors you would like to visit.

```
CREATE QUERY khop(VERTEX<MyNode> start_node, INT depth) for graph GraphName{
OrAccum @visited = false;
SumAccum<int> @@loop=0;
Start = {start_node};
Start = SELECT v
FROM Start:v
ACCUM v.@visited = true;
WHILE (@@loop < depth) DO
Start = SELECT v
FROM Start:u - (MyEdge:e)->:v
WHERE v.@visited == false
ACCUM v.@visited = true;
@@loop += 1;
END;
PRINT Start.size();
}
```