[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What is the cost of A* search in the worst case? anyone has
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 13
Thread images: 2
File: 1453166936405.jpg (94 KB, 720x1280) Image search: [Google]
1453166936405.jpg
94 KB, 720x1280
What is the cost of A* search in the worst case?

anyone has the answer for this retarded question?
>>
>>54975678
The time complexity of A* depends on the heuristic. In the worst case, the number of nodes expanded is exponential in the length of the solution (the shortest path), but it is polynomial when the search space is a tree, there is a single goal state, and the heuristic function h meets a certain criteria:
>>
>>54976774
>In the worst case, the number of nodes expanded is exponential in the length of the solution (the shortest path),
What? No it's not. You can trivially construct an input where the length of the shortest path is 1 but the algorithm takes an arbitrary amount of time to finish.
>>
>>54975678
What?
>>
>>54976774
i saw it on wikipedia
>>54976852
can you eloberate
>>
>>54975678
idk dude I wish there was a place where you could just look it up
>>
>>54977335
its the last two word of the question. also i need to explain why.
>>
>>54977343
A* with a bad heuristic is basically going to work like breadth first search.
>>
>>54977343
Do your own homework.
>>
>>54977686
incorrect.
without a heuristic, the search will be a breadth first search.
You can make a heuristic that makes performance worse.
Eg if you search for the longest path.
>>
>>54977977
fuck off witty, its better than asking for naked cartoon girls.

>>54978058
what happens if there is a same length for every possible node? is it gonna break
>>
>>54978296
>its better than asking for naked cartoon girls
But neither is appropriate for this board.
>>
>>54978296
>what happens if there is a same length for every possible node? is it gonna break
Lets assume your heursitic says that the distance is the same on every path.
And assuming the real distance is the same on every path, you will most likely keep them in the order you are searching, so nothing changes. It still works fine.

Try making an application where you use A*.
Like solve a maze or something.
It shouldn't take you more than an hour to implement.
Thread replies: 13
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.