<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gitesh Talapady</title>
    <description>The latest articles on DEV Community by Gitesh Talapady (@gitesh_talapady_0505).</description>
    <link>https://dev.to/gitesh_talapady_0505</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4166677%2F8fcc8dc8-e418-43e4-98d2-626d5540c7e7.jpg</url>
      <title>DEV Community: Gitesh Talapady</title>
      <link>https://dev.to/gitesh_talapady_0505</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gitesh_talapady_0505"/>
    <language>en</language>
    <item>
      <title>Implementing A* Search on a Grid-Based Path-Finding Map with Obstacle Avoidance</title>
      <dc:creator>Gitesh Talapady</dc:creator>
      <pubDate>Tue, 06 Oct 2026 14:35:33 +0000</pubDate>
      <link>https://dev.to/gitesh_talapady_0505/implementing-a-search-on-a-grid-based-path-finding-map-with-obstacle-avoidance-4jki</link>
      <guid>https://dev.to/gitesh_talapady_0505/implementing-a-search-on-a-grid-based-path-finding-map-with-obstacle-avoidance-4jki</guid>
      <description>&lt;p&gt;Introduction&lt;br&gt;
Path finding is a fundamental problem in Artificial Intelligence and computer science. The objective of path finding is to determine a suitable route between a starting point and a destination while considering restrictions such as obstacles or blocked areas.&lt;br&gt;
Path-finding algorithms are commonly used in video games, robotics, navigation systems, warehouse automation, and autonomous vehicles. One of the most popular algorithms for solving this problem is A (A-star) Search*.&lt;br&gt;
A* Search combines the actual distance already travelled with an estimated distance to the destination. This allows it to efficiently search for a path while avoiding unnecessary areas of the map.&lt;/p&gt;

&lt;p&gt;Representing the Map as a Grid&lt;br&gt;
For this implementation, the environment can be represented using a two-dimensional grid. Each cell represents a possible position.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
S  .  .  #  .&lt;br&gt;
.  #  .  #  .&lt;br&gt;
.  #  .  .  .&lt;br&gt;
.  .  #  .  .&lt;/p&gt;

&lt;h1&gt;
  
  
  .  .  .  G
&lt;/h1&gt;

&lt;p&gt;Here:&lt;br&gt;
S represents the starting position.&lt;br&gt;
G represents the goal.&lt;br&gt;
. represents a free cell.&lt;/p&gt;

&lt;h1&gt;
  
  
  represents an obstacle.
&lt;/h1&gt;

&lt;p&gt;The objective is to find a path from S to G without passing through the obstacle cells.&lt;/p&gt;

&lt;p&gt;What is A* Search?&lt;br&gt;
A* Search is an informed search algorithm that uses a cost function:&lt;br&gt;
    f(n) = g(n) + h(n)&lt;br&gt;
where:&lt;br&gt;
g(n) represents the actual cost of reaching the current cell from the starting point.&lt;br&gt;
h(n) represents the estimated cost from the current cell to the goal.&lt;br&gt;
f(n) represents the total estimated cost of the path through that cell.&lt;br&gt;
The algorithm selects the cell with the lowest estimated total cost and continues searching from there.&lt;/p&gt;

&lt;p&gt;Heuristic Function&lt;br&gt;
The heuristic is one of the most important components of A* Search. For a grid where movement is allowed only horizontally and vertically, Manhattan distance can be used.&lt;/p&gt;

&lt;p&gt;The formula is: h(n)=|x_1-x_2|+|y_1-y_2|&lt;br&gt;
where (x₁, y₁) represents the current position and (x₂, y₂) represents the goal.&lt;/p&gt;

&lt;p&gt;For example, if the current position is (2,3) and the goal is (5,6):&lt;br&gt;
    h(n)=|2-5|+|3-6| &lt;br&gt;
    h(n)=3+3=6&lt;br&gt;
Thus, the estimated distance to the goal is 6 steps.&lt;/p&gt;

&lt;p&gt;Working of A* Search&lt;br&gt;
The algorithm begins at the starting cell and examines its neighboring cells.&lt;br&gt;
For each possible neighboring cell:&lt;br&gt;
Check whether the cell is inside the grid.&lt;br&gt;
Check whether it is an obstacle.&lt;br&gt;
Calculate the movement cost.&lt;br&gt;
Calculate the heuristic cost.&lt;br&gt;
Calculate the total cost using:&lt;br&gt;
   f(n)=g(n)+h(n)&lt;br&gt;
Select the most promising cell.&lt;br&gt;
Continue the process until the goal is reached.&lt;br&gt;
Once the goal is found, the algorithm traces the selected cells backward to reconstruct the final path.&lt;/p&gt;

&lt;p&gt;Obstacle Avoidance&lt;br&gt;
Obstacle avoidance is an important part of the implementation. When A* encounters a cell containing an obstacle, it simply ignores that cell and evaluates other available neighboring cells.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
S  .  .  .  .&lt;/p&gt;

&lt;h1&gt;
  
  
  #  #  .
&lt;/h1&gt;

&lt;p&gt;.  .  .  .  G&lt;br&gt;
The algorithm cannot move directly through the blocked cells. Instead, it searches for an alternative route around them.&lt;/p&gt;

&lt;p&gt;A possible path can be represented as:&lt;br&gt;
S → → → →&lt;br&gt;
        ↓&lt;br&gt;
← ← ← ← G&lt;br&gt;
The actual path depends on the location of the obstacles and the movement rules defined for the grid.&lt;/p&gt;

&lt;p&gt;Basic Algorithm&lt;br&gt;
The implementation of A* can be summarized as follows:&lt;br&gt;
Create the grid.&lt;br&gt;
Mark the starting and goal positions.&lt;br&gt;
Mark blocked cells as obstacles.&lt;br&gt;
Add the starting cell to the open list.&lt;br&gt;
Select the cell having the lowest f(n) value.&lt;br&gt;
Examine its neighboring cells.&lt;br&gt;
Ignore invalid or blocked cells.&lt;br&gt;
Calculate g(n), h(n), and f(n).&lt;br&gt;
Add suitable cells to the search list.&lt;br&gt;
Repeat until the goal is reached.&lt;br&gt;
Trace the parent cells to obtain the final path.&lt;/p&gt;

&lt;p&gt;Applications&lt;br&gt;
A* Search has several practical applications:&lt;br&gt;
Video games: Finding routes for characters and enemies.&lt;br&gt;
Robotics: Helping robots navigate around obstacles.&lt;br&gt;
GPS and navigation: Finding efficient routes between locations.&lt;br&gt;
Warehouse automation: Guiding automated vehicles around shelves.&lt;br&gt;
Autonomous systems: Planning movement through an environment.&lt;br&gt;
Maze solving: Finding paths through blocked environments.&lt;/p&gt;

&lt;p&gt;Advantages&lt;br&gt;
A* Search offers several advantages:&lt;br&gt;
It can find an optimal path when an appropriate heuristic is used.&lt;br&gt;
It considers obstacles during path planning.&lt;br&gt;
It is generally more efficient than uninformed search methods.&lt;br&gt;
It can be implemented on simple grid-based maps.&lt;br&gt;
Its working can be visualized easily.&lt;/p&gt;

&lt;p&gt;Limitations&lt;br&gt;
A* may require considerable memory because it stores information about the cells being explored. Its performance also depends on the heuristic function used. A poorly selected heuristic can result in unnecessary exploration and slower execution.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
A* Search is an important path-finding technique that combines actual movement cost with an estimated distance to the destination. When implemented on a grid, it can effectively find a route while avoiding obstacles. Because of its efficiency and practical applications, A* is widely used in artificial intelligence, games, robotics, navigation, and autonomous systems.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Simulating Trie Data Structure: Building a Search-as-You-Type Engine</title>
      <dc:creator>Gitesh Talapady</dc:creator>
      <pubDate>Tue, 06 Oct 2026 14:29:37 +0000</pubDate>
      <link>https://dev.to/gitesh_talapady_0505/simulating-trie-data-structure-building-a-search-as-you-type-engine-gne</link>
      <guid>https://dev.to/gitesh_talapady_0505/simulating-trie-data-structure-building-a-search-as-you-type-engine-gne</guid>
      <description>&lt;p&gt;Introduction&lt;br&gt;
In today's digital world, searching for information has become an essential part of almost every software application. Whether we are searching for a product on an e-commerce website, a contact on a smartphone, or a word in a search engine, applications often provide suggestions while we type. This feature is commonly known as search-as-you-type or autocomplete.&lt;br&gt;
Behind this simple-looking feature, efficient data structures are required to quickly find words that match the characters entered by the user. One of the most suitable data structures for this purpose is the Trie, also known as a Prefix Tree.&lt;br&gt;
A Trie stores words in a tree-like structure where each node represents a character. It is particularly useful for searching words based on prefixes, making it an excellent choice for implementing an autocomplete system.&lt;/p&gt;

&lt;p&gt;Understanding the Trie Data Structure&lt;br&gt;
A Trie consists of nodes connected to one another. Each node represents a character, and a complete word is identified by marking its final character as the end of a word.&lt;br&gt;
Consider the following word list:&lt;br&gt;
Apple&lt;br&gt;
Application&lt;br&gt;
Apply&lt;br&gt;
App&lt;br&gt;
Banana&lt;br&gt;
Ball&lt;br&gt;
The words beginning with "App" share the same path in the Trie. Therefore, when a user enters app, the system can directly reach the corresponding node and find all the words stored below it.&lt;br&gt;
This is different from a traditional linear search, where the application may need to compare the entered prefix with every word in the list.&lt;/p&gt;

&lt;p&gt;How a Search-as-You-Type Engine Works&lt;br&gt;
The implementation can be divided into two major operations: insertion and search.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Inserting Words&lt;br&gt;
First, all words from the word list are inserted into the Trie. Each word is processed character by character.&lt;br&gt;
For example, while inserting the word "apple", nodes are created for:&lt;br&gt;
a → p → p → l → e&lt;br&gt;
If another word such as "application" is inserted, the existing a → p → p path can be reused.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Searching for a Prefix&lt;br&gt;
When a user types a prefix, the Trie follows the corresponding characters.&lt;br&gt;
For example:&lt;br&gt;
User enters: app&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Trie navigates through:&lt;br&gt;
a → p → p&lt;/p&gt;

&lt;p&gt;After reaching the app node, the system explores the remaining branches and produces suggestions such as:&lt;br&gt;
app&lt;br&gt;
apple&lt;br&gt;
application&lt;br&gt;
apply&lt;br&gt;
This makes the search process efficient, especially when the dictionary contains thousands or millions of words.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
Suppose our word list contains:&lt;br&gt;
apple&lt;br&gt;
application&lt;br&gt;
apply&lt;br&gt;
app&lt;br&gt;
banana&lt;br&gt;
ball&lt;br&gt;
bat&lt;/p&gt;

&lt;p&gt;If the user enters:&lt;br&gt;
ba&lt;/p&gt;

&lt;p&gt;the autocomplete system can return:&lt;br&gt;
banana&lt;br&gt;
ball&lt;br&gt;
bat&lt;/p&gt;

&lt;p&gt;If the user enters:&lt;br&gt;
app&lt;/p&gt;

&lt;p&gt;the system returns:&lt;br&gt;
app&lt;br&gt;
apple&lt;br&gt;
application&lt;br&gt;
apply&lt;br&gt;
Thus, the Trie provides a natural way of organizing words according to their prefixes.&lt;/p&gt;

&lt;p&gt;Algorithm&lt;br&gt;
The basic algorithm for a Trie-based autocomplete system is:&lt;br&gt;
Create an empty Trie.&lt;br&gt;
Insert every word from the word list.&lt;br&gt;
Accept a prefix from the user.&lt;br&gt;
Traverse the Trie according to the characters of the prefix.&lt;br&gt;
If the prefix does not exist, display "No suggestions found."&lt;br&gt;
If the prefix exists, traverse its child nodes.&lt;br&gt;
Collect all complete words.&lt;br&gt;
Display the collected words as suggestions.&lt;/p&gt;

&lt;p&gt;Applications&lt;br&gt;
Trie-based search is useful in many real-world applications, including:&lt;br&gt;
Search engine autocomplete&lt;br&gt;
Mobile keyboard suggestions&lt;br&gt;
Dictionary and spell-checking applications&lt;br&gt;
Contact search&lt;br&gt;
E-commerce product search&lt;br&gt;
Code editors and IDEs&lt;br&gt;
File and directory search systems&lt;br&gt;
Command-line autocomplete&lt;/p&gt;

&lt;p&gt;Advantages&lt;br&gt;
The main advantage of a Trie is its efficient prefix-based searching capability. It does not need to compare the complete prefix against every word individually. It also allows words having common prefixes to share nodes.&lt;/p&gt;

&lt;p&gt;Other advantages include:&lt;br&gt;
Fast prefix searching&lt;br&gt;
Suitable for autocomplete systems&lt;br&gt;
Easy retrieval of all words with a given prefix&lt;br&gt;
Effective for large dictionaries&lt;br&gt;
Simple and logical tree-based structure&lt;/p&gt;

&lt;p&gt;Limitations&lt;br&gt;
Although Tries are efficient, they can require more memory because every character may be represented by a separate node. For very large dictionaries, memory optimization techniques may therefore be required.&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
The Trie data structure provides an efficient solution for building a search-as-you-type engine. By storing words according to their prefixes, it can quickly identify matching words and generate suggestions. This concept demonstrates how selecting an appropriate data structure can significantly improve the performance of a software application. Trie-based searching continues to be useful in search engines, keyboards, dictionaries, and many other systems where fast prefix matching is required.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>coding</category>
      <category>computerscience</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
