Graphs and Relational Learning
Count the network’s connections
BOTIE
Examples, experiments and workspace controls
Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.
Try your own inputs
Add one connection to the adjacency matrix. For an undirected graph, change the mirrored entry too. Predict which nodes' neighbour counts will change before checking the output.
Context for this challenge
Add the entries in each adjacency row.
Botie needs each pump's number of neighbours while preserving which adjacency row belongs to which pump.
Add each row of the undirected binary adjacency matrix separately.
Examples and results
- Undirected binary adjacency matrix
0 1 0 1 0 1 0 1 0 - Required result
- 01
- 12
- 21
- Undirected binary adjacency matrix
0 1 1 0 - Required result
- 01
- 11
Try a fresh construction
This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.
Stuck? Inspect a worked construction
The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.
Assumptions and test precision
For weighted graphs, row sums measure total weight instead of neighbour count. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
A hub connects three instruments
This check uses the pieces from “Count neighbours without merging pump identities”.
BOTIE
- Undirected binary adjacency matrix
0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 0
Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
What would row totals mean if the adjacency entries represented connection weights instead of binary edges?
A graph matrix's entry meaning determines whether its sum measures neighbour count or total connection weight.
For weighted graphs, row sums measure total weight instead of neighbour count.
Work through the Python challenges →