Questions tagged [search-algorithms]
Algorithms for finding an element in some specified data-structure (most commonly, in a tree).
701
questions
0
votes
1
answer
8
views
Is there an A*/D* variant for graph where path to destination is unraveled based on whether it's closer to the destination?
I have a few constraints in my path finding application for source to destination routing on a map:
Server has a huge map and Client can only query a small chunk of it at a time because of data ...
1
vote
2
answers
43
views
Finding two disjont longest possible vertical or horizontal lines in 2D matrix with non-usable cells
The problem is to find two disjont longest possible (but with equal length) horizontal or vertical lines in given 2D matrix, where some cells are excluded from use. The disjont means that any cell ...
1
vote
2
answers
40
views
O(N log N) algorithm/implementation for maximum inner product search
I am in a situation where I have a query space Q and a key space K, both filled with N d-dimensional real vectors (N ≈ 10^6, d ≈ 50). For each query q, I want to find the k≈10 keys k_i that have the ...
1
vote
1
answer
36
views
Best Search Algorithim
In Microsoft Power Bi there are formulas that can be used in visualizations called measures. These measures can be used within the formulas of other measures.
As a result, a measure can have a complex ...
14
votes
3
answers
3k
views
Why are search problems assumed to have the structure of "find a path in a graph"?
I have skimmed a few introductions to "search problems", and I have noticed that:
Stated informally search problems are defined as "find an object y inside a larger space/object X"...
0
votes
0
answers
18
views
What algorithm should be used to find the closest set of dates?
I have tried to outline my problem as structured as possible, here is a rough overview, I am trying to find the best matching stay for a hotel booking system. If someone inputs check in and checkout ...
1
vote
1
answer
143
views
Finding the smallest root
We are given an array $a$ of $n$ integers, such that the difference between each element $a[i]$ and the adjacent elements $a[i-1]$ and $a[i+1]$ is at most $1$.
Define a root of $a$ as an index $k$ in $...
0
votes
2
answers
43
views
Recursive grid search of a sorted matrix
I have an algorithm that is checking whether the given key is present in the 2D sorted array where each row is sorted in an ascending order from left to right and ...
0
votes
1
answer
33
views
Is this depth search correct (DFS) Shouldn't one act according to the LIFO principle?
Shouldn't we actually continue with C after A, thought a depth search, follows the LIFO principle, isn't C the last node added in this case and shouldn't we expand C before B?
2
votes
1
answer
85
views
Graph labyrinth solving sequence
Starting from a vertex of an unknown, finite, strongly connected directed graph, we want to 'get out' (reach the vertex of the labyrinth called 'end'). Each vertex has two exits (edge which goes from ...
1
vote
1
answer
78
views
How to find largest caterpillar in a tree
A caterpillar is a subgraph which consists of a path with at most four leaves (legs) attached to each node (but a node can also have no leaves). This is not the same as finding the longest path, ...
2
votes
1
answer
54
views
Maximum of a tritonic array
I have found out how to find the maximum of a "bitonic" array. The problem is as follows.
An array is bitonic if it is comprised of an increasing or decreasing sequence of integers followed ...
0
votes
2
answers
70
views
Correctness proof of bubble sort(bogus proof)
I am aware of bubble sort correctness proof. But what is wrong with following argument while using induction.
Proof: Assume correctness of array size $1$ and $n$ (base and hypothesis). Then for ...
2
votes
1
answer
317
views
Prove the relation between space complexity and time complexity of the graph search which uses "the explored set"
I was referring to the textbook Artificial Intelligence: A modern approach 3rd by Stuart Russell and Peter Norvig.
what to prove about the general "graph search": (Here I assume "within ...
4
votes
2
answers
781
views
What is the name of this search algorithm?
I was thinking about an efficient binary search for unsorted arrays with $n$ entirely unique elements, and came up with something that probably already exists. Here's how it works:
At each level of ...