Network effects in marketing in Digital Marketing - Time & Space Complexity
Network effects in marketing describe how the value of a product or service grows as more people use it.
We want to understand how the impact or reach grows as the number of users increases.
Analyze the time complexity of this simple network effect model.
function calculateNetworkValue(users) {
let value = 0;
for (let i = 1; i <= users; i++) {
for (let j = 1; j <= users; j++) {
if (i !== j) {
value += 1; // each user connects with every other user
}
}
}
return value;
}
This code calculates the total number of possible connections between users in a network.
Identify the loops, recursion, array traversals that repeat.
- Primary operation: Counting connections between each pair of users.
- How many times: The inner loop runs once for every user in the outer loop, so roughly users x users times.
As the number of users grows, the number of connections grows much faster.
| Input Size (users) | Approx. Operations (connections) |
|---|---|
| 10 | 90 |
| 100 | 9,900 |
| 1000 | 999,000 |
Pattern observation: When users double, connections roughly quadruple, showing a fast growth.
Time Complexity: O(n²)
This means the work needed grows roughly with the square of the number of users.
[X] Wrong: "Adding more users only increases connections a little bit."
[OK] Correct: Each new user connects with all existing users, so connections grow very quickly, not slowly.
Understanding how network effects scale helps you explain why some products become more valuable as more people join.
What if connections only happened between new users and a fixed number of existing users? How would the time complexity change?