Home > Net >  Is is still considered a BFS algorithm if I modify it A little bit?
Is is still considered a BFS algorithm if I modify it A little bit?

Time:01-13

So I'm trying to create a program that finds the shortest path from nodeA to nodeB, however, I want to block certain nodes so that it would find another path. I'm not really aiming for an optimal code here I'm just trying things out, exploring etc.

Is it still considered a BFS if I modify it a little?

CodePudding user response:

Yes, it still is a BFS, with just a few constraints. The essence of BFS algorithm is the way it explores the graph, you are just exploring a subgraph (through filtering out a bit of it).

  • Related