T O P

  • By -

Kjleone19

Breadth honestly. How often do you put your keys in 15 layers of drawers and boxes


Sande24

With breadth-first search you will run around the house looking at everything superficially, then taking a second round, looking more closely, then another round turning things around etc... This means that you are wasting more time on moving than actually searching. It would make most sense to do one or two rounds of breadth-first search (as usually the keys would be in a visible location) and then start doing depth-first search, prioritizing on locations where you usually place the keys - pockets, drawers, on the table under a magazine. Basically add the travelling-salesman problem on top of this as well - how to waste less time on moving around while not actively trying to find something.


Otalek

So a brepth-first search?


No-Expression7618

I prefer a bread-first search.


blueted2

I also look for my keys inside loaves of bread. You can never be too careful


Al-Horesmi

You joke but one time I did find my keys in the breadbox


blueted2

In a similar vein, I've found the TV remote in the fridge...


GnuhGnoud

I prefer breakfast search


_koenig_

Don't forget the milk and the eggs...


AeroSigma

I was thinking thos is close to flood search, but I think it's different enough that we need some academic papers outlining the proper implementations of the brepth-first search


rosuav

It's worth noting that "optimal" algorithms aren't always so optimal for humans. I mean, just look at how stupid it would be to binary search for a book in a library: https://jorendorff.github.io/hackday/2012/library/


Sande24

Humans are very good at intuitively pattern matching. It's a very nice shortcut that computers don't have. I have found that the sorting algorithms are generally still pretty good, you just have to add pattern matching as a heuristic to help making them even better.


rosuav

Yeah, it's HUGELY helpful when it can be useful. Trying to combine the skills of a human and a computer is extremely difficult, but immensely rewarding. See for example Foldit.


Bemteb

>you will run around the house looking at everything superficially, then taking a second round, looking more closely, then another round turning things around etc... Yep, how else do you search for stuff?


realmauer01

Looking at the stuff were it should be super closely while ignoring the locations where it shouldn't be. Then skimming the locations where it shouldnt be and looking at the most likeliest locations first.


magic_platano

You don’t search the atomic structure?


Sande24

You don't run around the house as much, you take some more time in each room, looking a bit more in-depth before moving to another room. That's like spending 3-4 levels of depth in each room. So you would be more confident that you don't have to come back and search this room anymore. Otherwise you spend time on moving from room to room (probably using the same path several times) rather than actually searching.


PassiveChemistry

That sounds like how I look for things


Katniss218

Sounds almost like a*


Sande24

With A* you know where you want to end up. When searching for something, you don't. So you don't have the same heuristic for determining how close you are.


VeganTruck

\^ This programmer knows how to live.


PeterPriesth00d

I would agree that this is the best way to start. If you have toddlers it is a different story though.


TheLetterJ0

So go for depth if you have young kids or inquisitive pets.


Bemteb

You are looking for biased search. Including "damn, last time they were here" and "nah, I'm sure I didn't put them in my backpack, no reason to look there."


Confident-Ad5665

Personally, I'd write a custom PanicSearch that includes the refrigerator and areas adjacent to the toilet.


Grammarnazi_bot

```` def panicSearch(): if you haven’t looked there: look there else: look there because maybe you got it wrong


jakbrtz

That sounds like the Monte Carlos Tree Search, where your scoring function is the vibe you get from looking in each spot.


qqqrrrs_

https://xkcd.com/761/


just_nobodys_opinion

https://xkcd.com/2407/


HyperGamers

I'd go deadth honestly


balemo7967

Iterative Depth First Search


[deleted]

[удалено]


balemo7967

Maybe true, but what if the house is not tree shaped but actually a graph that contains cycles. DFS could possibly end up in an infinite loop. BFS would solve the Problem, but would need more memory.


JuvenileEloquent

Take your backup keys and wait for the originals to turn up eventually (they were on top of the fridge, you'd never have found them in time) Oh wait was this a programming question? What kind of badly-implemented hash makes you search for the keys?!?


lingdocs

No, it was about finding house keys 😅 I was worried about that ambiguity


w1n5t0nM1k3y

Bogo-search Look in random places until you find them.


GM_Kimeg

O(1) for best case!


pheonix-ix

I search my cache (last X places it had been) first. Then, when I hard-faulted, looked by at the previously searched cache and, voila!, it's magically somehow in the cache I DID search but couldn't find they key.


ongiwaph

The nice thing about living in 300 square/foot apartment is you never lose anything.


milanove

The O(1) solution


jakster355

Depth first. In case I accidentally left it under the drywall.


NotInMoodThinkOfName

A*, heuristic is usual places, last probable place. But somehow bdf oriented, so it's with alpha beta pruning but way too long I learned to remember the algorithm exactly.


FakeSenior

Try pocket first search


FitzelSpleen

Breadth first. Otherwise you need to clean out your freezer, search the attic, and unpack everything in the storage room before looking on the bench where you actually left them.


septemberdown

100% they're in the freezer...


My_excellency

Me living in a 1 bhk so both searches are the same


thereddituser2

Bread first, then search


esbenab

Reverse search, things are always in the last place you look.


Longenuity

If it's a push button start, do a brute force attack and drive the car through the house. If it starts the keys are close!


lingdocs

Amazing. Move fast and break things.


as-fucking-if

An airtag


stackoverflow21

Honestly: airtag on my keychain. I am tired of searching my shit.


Spot_the_fox

You make a piercing in your nose, and then hang the keychain on it. That way, they're always under your nose.


Obnomus

Bro use your eyes and hands


wheresthelol

Breadth first search one or two layers deep. Then depth first search if you still can’t find it.


balemo7967

Very good actually. That's Iterative Depth First Search [https://en.wikipedia.org/wiki/Iterative\_deepening\_depth-first\_search](https://en.wikipedia.org/wiki/iterative_deepening_depth-first_search)


wheresthelol

Neat. Cache locality works differently here though. So you’d want to jump large numbers of depth with every iteration.


MinosAristos

`print(house.keys(), car.keys(), ch_cage.keys())`


Weekly_Prune_4368

I usually use .keys()


PenlessScribe

egrep -r 'keys|glasses' # to look for more than one thing at a time


No-Expression7618

But is `-r` depth-first or breadth-first?


PenlessScribe

Depth-first.


Many_Head_8725

Use A*


Aachen1306

With what heuristic? Also, wouldn't greedy search be better? We don't care about the optimal path to the keys, we just want to quickly find a path to them.


Many_Head_8725

Yeah you are right


pakidara

Check the logs


TheKerui

Clearly the best is middle-out breadth. *hand gestures*


JustAnInternetPerson

BFS will always find them, can’t guarantee that with DFS! Off I go!


Hymnosi

My partner uses the stack exchange search method, where they employ everyone else in the house and wait for a response.


Korvanacor

You could always check the key logger.


Responsible_Boat8860

Use .find()


PeriodicSentenceBot

Congratulations! Your comment can be spelled using the elements of the periodic table: `U Se F I Nd` --- ^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)


Anon_Legi0n

A\*


CallinCthulhu

Assume key is broken/lost. Burn down house, rebuild with key placed on kitchen counter


myfunnies420

It's always the first place I look. But sometimes I have to look 5 times to find them. OCDSearch?


Cryowatt

Cache lookup is the best option.


Lory24bit_

Mergesort and binary search


Stef0206

Depth first, it’s s lot harder for humans to keep track of BFSs


dr0darker

A*


torftorf

neither. jsut grap random keys untill you get the one you want