Informed search algorithms

In the previous articles, we talked about depth-first and breadth-first searches. One thing common between the two is that they are sort of blindly searching through the node, not taking into account any knowledge of the goal. That way, they are uninformed algorithms. In other words, they have no prior knowledge of the goal.

However, in most real-world problems, you will have some idea or sense of direction towards the goal. Informed search algorithms will take that into account. For example, if you have to get from point A to point B on a map, you will know in which…


Part 2: Breadth-First Search

To check out Depth-First Search, check out part 1.

Breadth-First Search (BFS)

Unlike DFS, which goes deep in a certain direction first before considering another direction, BFS will analyze the next node in each possible direction first and then repeat the process for the next node in each direction. So instead of working on one path/direction all the way, it is analyzing all the possible paths at the same time, node to node. It will analyze the first node in each direction, and then analyze the second node each direction, and repeat the process until the target node is found. …


Part 1: Depth-First Search

What is a graph data structure?

A Graph is a data structure consisting of finite number of nodes (or vertices) and edges that connect them. Consider the picture below:


Artificial Intelligence (AI) has become a common phrase in current day and it no longer surprises us what some of the AI based systems used in our daily lives can achieve. However, this is a result of decades of progress. In this article, I present to you a brief history of AI. Pretty much all of it is a summary of a chapter in the book “Artificial Intelligence A Modern Approach” by Stuart J. Russell and Peter Norvig. It can be found here:

What is AI?

Before we define artificial intelligence, let us define intelligence. There are many ways to…


(Image Source)

Python provides a very strong module for manipulating date and time. This is specially useful in financial data since most financial data is time series data. Let’s start by import the module.

import datetime

The first step would be to check the time right now:

print(datetime.datetime.now())

We can also create a datetime object by passing in the year, month and day. So if we had to create an object for today’s date, we will do as follow:

today = datetime.datetime(2021, 1, 13)print(today)

Similary you can also add time. For example, we can add 3:15 pm to the date above:


(Image Source)

This article is a continuation to the first one, in which we learned how to create data frames and load data into data frames from CSV and Excel files.

In today’s tutorial, we will learn how to select data from a data frame. Let’s download stocks data from Yahoo Finance by clicking the download link on the page, which lets you download the data as a CSV file. This is historic data of S&P 500 stocks. I renamed the file to stocks.csv. Let’s start by importing pandas and load data from the CSV file. …


(Image Source)

This pandemic has completely changed our perception of the world we live in. At this point, almost all of us have been affected by it in one way of another. A lot of unfortunate souls have been lost to it and the struggle is still ongoing.

A lot of patients when they come into a hospital, may have episodes of confusion often termed as hospital delirium. Many things play a role in causing hospital delirium, like being ill, in unfamiliar surroundings, lack of quality sleep, lack of social stimulation and certain medications. Things like social interactions, family visits, and familiar…


(Image Source)

What is pandas Data Frame?

The simplest way of describing Data Frame is to think of it as a spreadsheet or table, with rows and columns. Columns are labeled by column names and row have an index column. However, Data Frame is very efficient for large amount of data. It makes applying functions to the data very efficient, both in terms of coding as well as runtime. It is probably the most commonly used pandas data object.

First of all we will import pandas as pd:

import pandas as pd

Creating a Data Frame object:

There are a few ways…


Update (1/25/2021): It seems like the code no longer works, response is error 429 from instagram, which means too many requests. I will update it as soon as I can but until then, wanted to warn readers. I think having the code up might still help some and one can always make changes oneself so I am no taking the tutorial down for now but I will definitely get around to fixing it, thanks!

Disclaimer: Most of this code was obtained from other tutorials, I do not take credit for writing the selenium code. The purpose of this tutorial is…


(Image Source)

As a beginner in Python, lists have to be my favorite objects to work with. List comprehension reduces multiple lines of code to one line. However, if you have to work with big data, lists may not be the most efficient objects to work with. Therefore we need a more efficient alternative. Say hello to Python arrays.

Arrays behave much like lists but the content is type constrained. You have to specify the content type. Python arrays are much like arrays in C language. Consider using an array specially if your list is going to contain only numbers. When creating…

K. Nawab

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store