Lab Manual - LP2 - Sem - II - 2022 - 23
Lab Manual - LP2 - Sem - II - 2022 - 23
Marathwada Mitramandal’s
INSTITUTE OF TECHNOLOGY
Lohgaon, Pune-411047
LAB MANUAL
LP-II TE COMP
(2019 Pattern)
(Part 1)
Prepared By:
Prof. Vikas Chavan
Prof. Rohini Mahale
Savitribai Phule Pune University
Third Year of Computer Engineering (2019 Course) Home
Semeste
r VI
Teaching
Cou Course Name Scheme Examination Scheme and Marks Credit Scheme
rse (Hours/wee
Co k)
de
$ T
$ P T M E
e
P O T L P T T
r u id- nd r r o e r u o
a r a a a t
t Se - t c t
c m c l c o
o m Se a t a
t w t t r
r m l u l
i o i i i
i r
c r c c a
a e
a k a a l
l
l l l
Data Science and Big
31025 0 - - 3 7 - - - 1 0 - - 03
Data Analytics
1 4 0 0 0 3
0
31025 Web Technology 0 - - 3 7 - - - 1 0 - - 03
2 4 0 0 0 3
0
31025 Artificial Intelligence 0 - - 3 7 - - - 1 0 - - 03
3 4 0 0 0 3
0
31025 Elective II 0 - - 3 7 - - - 1 0 - - 03
4 4 0 0 0 3
0
10 04
31025 Internship** - - - - - 0 - - 1 - - -
**
5 0
* 0
*
Data Science and Big
31025 Data - 0 - - - 5 2 - 7 - 0 - 02
6 Analytics 4 0 5 5 2
Laboratory
Web Technology
31025 - 0 - - - 2 - 2 5 - 0 - 01
Laboratory
7 2 5 5 0 1
31025 Laboratory Practice II - 0 - - - 5 2 - 7 - 0 - 02
8 4 0 5 5 2
Total 1 1 - 12 2 2 5 2 7 1 0 - 21
2 0 0 8 2 0 5 0 2 9
0 5 0
31025 Audit Course 6 Grade
9
Total 1 0 - 21
2 9
310254 Elective II Options: 310259 Audit Course 6 Options:
310254(A) Information Security 310254(B) 310259(A) Digital and Social Media Marketing
Augmented and Virtual Reality 310254(C) 310259(B) Sustainable Energy Systems
Cloud Computing 310259(C) Leadership and Personality Development
310254(D) Software Modeling and Architectures 310259(D) Foreign Language
310259(E) Learn New Skills
#6/99
http://collegecirculars.unipune.ac.in/sites/documents/Syllabus2021/Forms/AllItems.aspx
Savitribai Phule Pune University
Third Year of Computer Engineering (2019 Course) Home
310258:Laboratory Practice II
Teaching Scheme Credit: 02 Examination Scheme and
Practical: 04 Marks Term Work: 50 Marks
Hours/Week Practical: 25 Marks
Companion Course: Artificial Intelligence (310253), Elective II (310254)
Course Objectives:
● To learn and apply various search strategies for AI
● To Formalize and implement constraints in search problems
● To understand the concepts of Information Security / Augmented and Virtual
Reality/Cloud Computing/Software Modeling and Architectures
Course Outcomes:
On completion of the course, learner will be able to
● Artificial Intelligence
CO1: Design a system using different informed search / uninformed search or
heuristic approaches
CO2: Apply basic principles of AI in solutions that require problem solving,
inference, perception, knowledge representation, and learning
CO3: Design and develop an interactive AI application
● Information Security
CO4: Use tools and techniques in the area of Information
Security CO5: Use the cryptographic techniques for problem
solving CO6: Design and develop security solution
OR
● Augmented and Virtual Reality
CO4: Use tools and techniques in the area of Augmented and Virtual Reality
CO5: Use the representing and rendering system for problem solving
CO6: Design and develop ARVR applications
OR
● Cloud Computing
CO4: Use tools and techniques in the area of Cloud Computing
CO5: Use cloud computing services for problem solving
CO6: Design and develop applications on cloud
OR
program listing to journal must be avoided. Use of DVD containing students programs maintained
by Laboratory In-charge is highly encouraged. For reference one or two journals may be maintained
with program prints in the Laboratory.
Guidelines for Laboratory /Term Work Assessment
Continuous assessment of laboratory work should be based on overall performance of Laboratory
assignments by a student. Each Laboratory assignment assessment will assign grade/marks based on
parameters, such as timely completion, performance, innovation, efficient codes, punctuality and
Guidelines for Practical Examination
Problem statements must be decided jointly by the internal examiner and external examiner. During
practical assessment, maximum weightage should be given to satisfactory implementation of the
problem statement. Relevant questions may be asked at the time of evaluation to test the student‘s
understanding of the fundamentals, effective and efficient implementation. This will encourage,
transparent evaluation and fair approach, and hence will not create any uncertainty or doubt in the
minds of the students. So, adhering to these principles will consummate our team efforts to the
promising start of student's academics.
Guidelines for Laboratory Conduction
The instructor is expected to frame the assignments by understanding the prerequisites, technological
aspects, utility and recent trends related to the topic. The assignment framing policy need to address
the average students and inclusive of an element to attract and promote the intelligent students. Use
of open source software is encouraged. Based on the concepts learned. Instructor may also set one
assignment or mini-project that is suitable to respective branch beyond the scope of syllabus.
Operating System recommended :- 64-bit Windows OS and
Linux Programming tools recommended: -
Information Security : - C/C++/Java
Augmented and Virtual Reality :- Unity, C#, Blender, VRTK, ARTK, Vuforia
VR Devices: HTC Vive, Google Daydream and Samsung gear
VR. Software Modeling and Architectures:-Front end:HTML5, Bootstarp, JQuery, JS etc.
Backend: MySQL /MongoDB/NodeJS
Virtual Laboratory:
Software Modeling and Architectures : http://vlabs.iitkgp.ernet.in/se
Information Security : http://cse29-iiith.vlabs.ac.in
Part I : Artificial Intelligence
Suggested List of Laboratory Experiments/Assignments
Sr. Group A
No
All assignments are compulsory
.
1. Implement depth first search algorithm and Breadth First Search algorithm, Use an
undirected
graph and develop a recursive algorithm for searching all the vertices of a graph or tree data
structure.
2. Implement A star Algorithm for any game search problem.
3. Implement Greedy search algorithm for any of the following application:
I. Selection Sort
II. Minimum Spanning Tree
III. Single-Source Shortest Path Problem
IV. Job Scheduling Problem
V. Prim's Minimal Spanning Tree Algorithm
VI. Kruskal's Minimal Spanning Tree Algorithm
VII. Dijkstra's Minimal Spanning Tree Algorithm
Group B
4. Implement a solution for a Constraint Satisfaction Problem using Branch and Bound and
Backtracking for n-queens problem or a graph coloring problem.
5. Develop an elementary catboat for any suitable customer interaction application.
Group C
3. Consider the online shopping system in the assignment 2. Draw the sequence diagram using
UML tool to show message exchanges
4. Consider your neighboring travel agent from whom you can purchase flight tickets. To book
a ticket you need to provide details about your journey i.e., on which date and at what time
you would like to travel. You also need to provide your address. The agency has recently
been modernized. So, you can pay either by cash or by card. You can also cancel a booked
ticket later if you decide to change your plan. In that case you need to book a new ticket again.
Your agent also allows you to book a hotel along with flight ticket. While cancelling a flight
ticket you can also cancel hotel booking. Appropriate refund as per policy is made in case of
cancellation.
Perform the following tasks and draw the use case diagram using UML tool.
a. Identify the use cases from a given non-trivial problem statement.
b. Identify the primary and secondary actors for a system.
c. Use to generalization of use cases and «include» stereotypes to prevent
redundancy in the coding phase
Mini-Projects
5. Select a moderately complex system and narrate concise requirement Specification for the
same. Design the system indicating system elements organizations using applicable
architectural styles and design patterns with the help of a detailed Class diagram depicting
logical architecture. Specify and document the architecture and design pattern with the help
of templates. Implement the system features and judge the benefits of the design patterns
accommodated.
Learning Resources
Text Books:
Artificial Intelligence
1. Stuart Russell and Peter Norvig, “Artificial Intelligence: A Modern Approach”, Third edition,
Pearson, 2003, ISBN :10: 0136042597
2. Deepak Khemani, “A First Course in Artificial Intelligence”, McGraw Hill Education(India),
2013, ISBN : 978-1-25-902998-1
3. Elaine Rich, Kevin Knight and Nair, “Artificial Intelligence”, TMH, ISBN-978-0-07-008770-5
Information Security
1. Atul Kahate, “Cryptography and Network Security”, 3e, McGraw Hill Education
2. Prakash C. Gupta, “Cryptography and Network Security”, PHI
3. V.K. Pachghare, “Cryptography and Information Security”, PHI Learning
Cloud Computing
1. A. Srinivasan, J. Suresh,” Cloud Computing: A Practical Approach for Learning and
Implementation”, Pearson, ISBN: 978-81-317-7651-3
2. Rajkumar Buyya, Christian Vecchiola, S. Thamarai Selvi, “Mastering Cloud Computing”,
McGraw Hill Education, ISBN-13:978-1-25-902995-0
Augmented and Virtual Reality
1. William R Sherman and Alan B Craig, “Understanding Virtual Reality: Interface, Application
and Design”, (The Morgan Kaufmann Series in Computer Graphics)”. Morgan Kaufmann
Publishers, San Francisco, CA, 2002
2. Alan B Craig, “Understanding Augmented Reality, Concepts and Applications”, Morgan
Kaufmann Publishers, ISBN:978-0240824086
Software Modeling and Architectures
1. Jim Arlow, Ila Neustadt, “UML 2 and the unified process –practical object-oriented analysis
and design”, Addison Wesley, Second edition, ISBN 978-0201770605
2. Len Bass, Paul Clements, Rick Kazman, ''Software Architecture in Practice", Second Edition,
Pearson ,ISBN 978-81-775-8996-2
3. Hassan Gomaa, “Software Modeling and Design- UML, Use cases, Patterns and Software
Architectures”, Cambridge University Press, 2011, ISBN 978-0-521-76414-8
4. Erich Gamma, “Design Patterns”, Pearson, ISBN 0-201-63361-2
Reference Books:
1. Nilsson Nils J , “Artificial Intelligence: A new Synthesis”, Morgan Kaufmann Publishers Inc.
San Francisco, CA, ISBN: 978-1-55-860467-4
2. Patrick Henry Winston, “Artificial Intelligence”, Addison-Wesley Publishing Company, ISBN:
0- 201-53377-4
3. Andries P. Engelbrecht, “Computational Intelligence: An Introduction”, 2nd Edition-Wiley
India-
ISBN: 978-0-470-51250-0
Information Security
1. William Stallings, Lawrie Brown, “Computer Security Principles and Practice”, 3rd_Edition,
Pearson
2. William Stallings, “Cryptography and Network Security Principals and Practice”, Fifth edition,
Pearson
3. Nina Godbole, Sunit Belapure, “Cyber Security”, Wiley, ISBN: 978-81-265-2179-1
Augmented and Virtual Reality
1. Steven M. LaValle, “Virtual Reality”, Cambridge University Press, 2016
2. Alan B Craig, William R Sherman and Jeffrey D Will, “Developing Virtual Reality Applications:
Foundations of Effective Design”, Morgan Kaufmann, 2009.
3. Schmalstieg / Hollerer, “Augmented Reality: Principles & Practice”, Pearson Education India; First
edition (12 October 2016),ISBN-10: 9332578494
Cloud Computing
1. James Bond ,“The Enterprise Cloud”, O'Reilly Media, Inc. ISBN: 9781491907627
2. Dr. Kris Jamsa, “Cloud Computing: SaaS, PaaS, IaaS, Virtualization and more”, Wiley Publications,
ISBN: 978-0-470-97389-9
3. Anthony T. Velte Toby J. Velte, Robert Elsenpeter, “Cloud Computing: A Practical Approach”, 2010,
The McGraw-Hill.
Software Modeling and Architectures
1. Gardy Booch, James Rambaugh, Ivar Jacobson, “The unified modeling language user guide” , Pearson
Education, Second edition, 2008, ISBN 0-321-24562-8.
2. Lan Sommerville, “Software Engineering”, 9th edition, ISBN-13: 978-0-13-703515-1 ISBN-10: 0- 13-
703515-2.
1 Implement a solution for a Constraint Satisfaction Problem using Branch and Bound and
Backtracking for n-queens problem or a graph coloring problem.
2 Develop an elementary catboat for any suitable customer interaction application.
Part I : Artificial Intelligence
Group C
Implement any one of the following Expert System
Aim/Title:
Implement depth first search algorithm and Breadth First Search algorithm, Use an undirected
graph and develop a recursive algorithm for searching all the vertices of a graph or tree data
structure.
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Intellij
Theory:
● Searching in AI:
o Search: Searching is a step by step procedure to solve a search-problem in a given search space.
A search problem can have three main factors:
o Search Space: Search space represents a set of possible solutions, which a system may have.
o Start State: It is a state from where agent begins the search.
o Goal test: It is a function which observe the current state and returns whether the goal state is
achieved or not.
● Search tree: A tree representation of search problem is called Search tree. The root of the
search tree is the root node which is corresponding to the initial state.
● Actions: It gives the description of all the available actions to the agent.
● Transition model: A description of what each action do, can be represented as a transition
model.
● Path Cost: It is a function which assigns a numeric cost to each path.
● Solution: It is an action sequence which leads from the start node to the goal node.
● Optimal Solution: If a solution has the lowest cost among all solutions.
● Properties of Search Algorithms:
● Following are the four essential properties of search algorithms to compare the efficiency of
these algorithms:
● Completeness: A search algorithm is said to be complete if it guarantees to return a solution if
at least any solution exists for any random input.
● Optimality: If a solution found for an algorithm is guaranteed to be the best solution (lowest
path cost) among all other solutions, then such a solution for is said to be an optimal solution.
● Time Complexity: Time complexity is a measure of time for an algorithm to complete its task.
● Space Complexity: It is the maximum storage space required at any point during the search,
as the complexity of the problem. Types of search algorithms
● Based on the search problems we can classify the search algorithms into uninformed
(Blind search) search and informed search (Heuristic search) algorithms.
● Uninformed Search:
The uninformed search does not contain any domain knowledge such as closeness, the location
of the goal. It operates in a brute-force way as it only includes information about how to traverse
the tree and how to identify leaf and goal nodes. Uninformed search applies a way in which
search tree is searched without any information about the search space like initial state operators
and test for the goal, so it is also called blind search. It examines each node of the tree until it
achieves the goal node
● Informed Search:
● Informed search algorithms use domain knowledge. In an informed search, problem
information is available which can guide the search. Informed search strategies can find a
solution more efficiently than an uninformed search strategy. Informed search is also called a
Heuristic search.
A heuristic is a way which might not always be guaranteed for best solutions but guaranteed to
find a good solution in reasonable time.
● Heuristic Search
It includes Blind Search, Uninformed Search, and Blind control strategy. These search
techniques are not always possible as they require much memory and time. These techniques
search the complete space for a solution and use the arbitrary ordering of operations.
The examples of Direct Heuristic search techniques include Breadth-First Search (BFS) and
Depth First Search (DFS).
Weak Heuristic Search techniques in AI
It includes Informed Search, Heuristic Search, and Heuristic control strategy. These techniques
are helpful when they are applied properly to the right types of tasks. They usually require
domain-specific information.
The examples of Weak Heuristic search techniques include Best First Search (BFS) and A*.
Before describing certain heuristic techniques, let's see some of the techniques listed below:
● Bidirectional Search
● A* search
● Simulated Annealing
● Hill Climbing
● Best First search
● Beam search
Algorithm:
//Graph ADT
class graph
{
struct node //create structure of node
{
int data;
node *next;
};
public:
node *head[20];
stack<node*> stack;
queue<node*> Q;
int visited[20], no;
void display();
void edge_v1_v2(int, int);
void edge_v2_v1(int, int);
void DFS();
void BFS();
};
}
}
//Insert an Edge
edge_v1_v2(int v1, int v2)
{
node *n, *f, *h;
if(f == NULL)
{
h->next = n;
head[v1] = h;
}
else
{
while(f->next)
f = f->next;
f->next = n;
}
Conclusion:In this assignment we have successfully implemented the DFS and BFS.
Assignment 2:
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Intellij
Theory:
A* Algorithm :
What is an A* Algorithm?
It is a searching algorithm that is used to find the shortest path between an initial and a final point.
It is a handy algorithm that is often used for map traversal to find the shortest path to be taken. A*
was initially designed as a graph traversal problem, to help build a robot that can find its own
course. It still remains a widely popular algorithm for graph traversal. It searches for shorter paths
first, thus making it an optimal and complete algorithm. An optimal algorithm will find the least
cost outcome for a problem, while a complete algorithm finds all the possible outcomes of a
problem. Another aspect that makes A* so powerful is the use of weighted graphs in its
implementation.
A weighted graph uses numbers to represent the cost of taking each
path or course of action. This means that the algorithms can take the path with the least cost, and
find the best route in terms of distance and time.
if(f == NULL)
{
h->next = n;
head[v1] = h;
}
else
{
while(f->next)
f = f->next;
f->next = n;
}
}
void graph :: display()
{
int i;
node *f;
for(i = 0 ; i < no; i++)
{
cout<<endl;
f = head[i];
while(f)
{
cout<<"\t"<<f->data;
f = f->next;
}
}
}
void graph :: Astar(int src, int goal){
node *f;
gn = 0;
f = head[src];
cout<<"\n Shortest Path is :";
cout<<src<<"\t";
while(src != goal){
f = head[src];
f = f->next;
fn = Max;
while(f){
if(fn > (gn + f->weight + Heuristic[f->data])){
gn = gn + f->weight;
fn = gn + Heuristic[f->data];
src = f->data;
}
f = f->next;
}
cout<<src<<"\t";
}
}
Output:
Conclusion:
Selection Sort
Minimum Spanning Tree
Single-Source Shortest Path Problem
Job Scheduling Problem
Prim's Minimal Spanning Tree Algorithm
Kruskal's Minimal Spanning Tree Algorithm
Dijkstra's Minimal Spanning Tree Algorithm
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Intellij
Theory:
Greedy Algorithm
The greedy method is one of the strategies like Divide and conquer used to solve the problems.
This method is used for solving optimization problems. An optimization problem is a problem
that demands either maximum or minimum results. Let's understand through some terms. The
Greedy method is the simplest and straightforward approach. It is not an algorithm, but it is a
technique. The main function of this approach is that the decision is taken on the basis of the
currently available information. This technique is basically used to determine the feasible solution
that may or may not be optimal. The feasible solution is a subset that satisfies the given criteria.
The optimal solution is the solution which is the best and the most favorable solution in the subset.
In the case of feasible, if more than one solution satisfies the given criteria then those solutions
will be considered as the feasible, whereas the optimal solution is the best solution among all the
solutions.
Pseudo code of Greedy Algorithm
Algorithm Greedy (a, n)
{
Solution : = 0;
for i = 0 to n do
{
x: = select(a);
if feasible(solution, x)
{
Solution: = union(solution , x)
}
return solution;
}
}
The above is the greedy algorithm. Initially, the solution is assigned with zero value. We pass the
array and number of elements in the greedy algorithm. Inside the for loop, we select the element
one by one and checks whether the solution is feasible or not. If the solution is feasible, then we
perform the union.
Minimal Spanning Tree:
A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges
of a connected, edge-weighted undirected graph that connects all the vertices together, without
any cycles and with the minimum possible total edge weight. That is, it is a spanning tree whose
sum of edge weights is as small as possible. [2] More generally, any edge-weighted undirected
graph (not necessarily connected) has a minimum spanning forest, which is a union of the
minimum spanning trees for its connected components.
Prim’s Algorithm:
It is a greedy algorithm. It starts with an empty spanning tree. The idea is to maintain two sets of
vertices:
o Contain vertices already included in MST.
o Contain vertices not yet included.
At every step, it considers all the edges and picks the minimum weight edge. After picking the
edge, it moves the other endpoint of edge to set containing MST.
Spanning tree - A spanning tree is the subgraph of an undirected connected graph.
Minimum Spanning tree - Minimum spanning tree can be defined as the spanning tree in which
the sum of the weights of the edge is minimum. The weight of the spanning tree is the sum of the
weights given to the edges of the spanning tree.
Prim's Algorithm is a greedy algorithm that is used to find the minimum spanning tree from a
graph. Prim's algorithm finds the subset of edges that includes every vertex of the graph such that
the sum of the weights of the edges can be minimized.
How does the prim's algorithm work?
Prim's algorithm is a greedy algorithm that starts from one vertex and continue to add the edges
with the smallest weight until the goal is reached. The steps to implement the prim's algorithm are
given as follows -
o First, we have to initialize an MST with the randomly chosen vertex.
o Now, we have to find all the edges that connect the tree in the above step with the new
vertices. From the edges found, select the minimum edge and add it to the tree.
o Repeat step 2 until the minimum spanning tree is formed.
The applications of prim's algorithm are -
o Prim's algorithm can be used in network designing.
o It can be used to make network cycles.
o It can also be used to lay down electrical wiring cables.
Example of prim's algorithm
Now, let's see the working of prim's algorithm using an example. It will be easier to understand
the prim's algorithm using an example.
Suppose, a weighted graph is -
Step 1 - First, we have to choose a vertex from the above graph. Let's choose B.
Step 2 - Now, we have to choose and add the shortest edge from vertex B. There are two edges
from vertex B that are B to C with weight 10 and edge B to D with weight 4. Among the edges,
the edge BD has the minimum weight. So, add it to the MST.
Step 3 - Now, again, choose the edge with the minimum weight among all the other edges. In this
case, the edges DE and CD are such edges. Add them to MST and explore the adjacent of C, i.e.,
E and A. So, select the edge DE and add it to the MST.
Step 4 - Now, select the edge CD, and add it to the MST.
Step 5 - Now, choose the edge CA. Here, we cannot select the edge CE as it would create a cycle
to the graph. So, choose the edge CA and add it to the MST.
So, the graph produced in step 5 is the minimum spanning tree of the given graph. The cost of the
MST is given below -
Cost of MST = 4 + 2 + 1 + 3 = 10 units.
Algorithm:
class graph
{
struct node //create structure of node
{
int data;
int weight;
node *next;
};
public:
node *head[20];
int no;
void display();
void edge_v1_v2(int, int, int);
void Prims();
};
if(f == NULL)
{
h->next = n;
head[v1] = h;
}
else
{
while(f->next)
f = f->next;
f->next = n;
}
}
void graph :: display()
{
int i;
node *f;
for(i = 0 ; i < no; i++)
{
cout<<endl;
f = head[i];
while(f)
{
cout<<"\t"<<f->data;
f = f->next;
}
}
}
Prims()
{
node *p;
int m, min_wt=0;
int v, v1, v2, wt;
int i,j;
int visited[10], vertex[10];
//Initialization
for(i=0; i<no; i++)
{
visited[i]=0; //identify whether vertex visited
vertex[i]=-1; //visited vertex inserted
}
vertex[0] = 0;
visited[0] = 1;
cout<<"\nMinimum Spanning Tree with minimum cost is\n";
cout<<head[0]->data;
for(i = 0; i<no-1; i++) //No. of vertices to visit
{
m = 9999; //set max value to find minimum cost
for(j=0; j<=i;j++) //check all edges of vistited vertex
{
v = vertex[j]; //get element from set of vertex
p = head[v]; //get header node
p = p->next;
while(p) //if p != NULL
{
if(visited[p->data] == 0)//identify whether vertex visited
{
wt = p->weight;
if(m > wt)
{
m = wt;
v1 = v;
v2 = p->data;
}
}
p = p->next;
}
}
cout<<" "<<head[v2]->data;
min_wt += m;
vertex[j] = v2;
visited[v2] = 1;
}
cout<<"\n Minimum cost is "<<min_wt<<endl;
cout<<endl;
}
Output:
Conclusion:
In this assignment we have successfully implemented the Minimum Spanning Tree with Prim’s
Algorithm
Group B
Assignment 4:
Aim/Title: Implement a solution for a Constraint Satisfaction Problem using Branch and Bound
and Backtracking for n-queens problem or a graph coloring problem
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Intellij
Theory:
Constraint Satisfaction Problem:
Constraint satisfaction is a technique where a problem is solved when its values satisfy certain
constraints or rules of the problem. Such type of technique leads to a deeper understanding of the
problem structure as well as its complexity. Constraint satisfaction depends on three components,
namely:
● X: It is a set of variables.
● D: It is a set of domains where the variables reside. There is a specific domain for each
variable.
● C: It is a set of constraints which are followed by the set of variables.
Types of Domains in CSP
There are following two types of domains which are used by the variables :
● Discrete Domain: It is an infinite domain which can have one state for multiple
variables. For example, a start state can be allocated infinite times for each variable.
● Finite Domain: It is a finite domain which can have continuous states describing one
domain for one specific variable. It is also called a continuous domain.
N—Queens Problem:
The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two
queens attack each other. For example, following is a solution for 4 Queen problem.
The expected output is a binary matrix which has 1s for the blocks where queens are placed. For
example, following is the output matrix for above 4 queen solution.
{ 0, 1, 0, 0}
{ 0, 0, 0, 1}
{ 1, 0, 0, 0}
{ 0, 0, 1, 0}
Backtracking Algorithm: The idea is to place queens one by one in different columns,
starting from the leftmost column. When we place a queen in a column, we check for clashes with
already placed queens. In the current column, if we find a row for which there is no clash, we
mark this row and column as part of the solution. If we do not find such a row due to clashes then
we backtrack and return false.
Branch and bound is an algorithm:
Branch and bound is an algorithm design paradigm which is generally used for solving
combinatorial optimization problems. These problems are typically exponential in terms of time
complexity and may require exploring all possible permutations in worst case. The N queens
puzzle is the problem of placing N chess queens on an N×N chessboard so that no two queens
threaten each other. Thus, a solution requires that no two queens share the same row, column, or
diagonal. In Branch and Bound solution, after building a partial solution, we figure out that there
is no point going any deeper as we are going to hit a dead end.
Let’s begin by describing backtracking solution. “The idea is to place queens one by one in
different columns, starting from the leftmost column. When we place a queen in a column, we
check for clashes with already placed queens. In the current column, if we find a row for which
there is no clash, we mark this row and column as part of the solution. If we do not find such a
row due to clashes, then we backtrack and return false.”
For the 1st Queen, there are total 8 possibilities as we can place 1st Queen in any row of first
column. Let’s place Queen 1 on row 3. After placing 1st Queen, there are 7 possibilities left for
the 2nd Queen. But wait, we don’t really have 7 possibilities. We cannot place Queen 2 on rows
2, 3 or 4 as those cells are under attack from Queen 1. So, Queen 2 has only 8 – 3 = 5 valid
positions left. After picking a position for Queen 2, Queen 3 has even fewer options as most of
the cells in its column are under attack from the first 2 Queens. We need to figure out an efficient
way of keeping track of which cells are under attack. In previous solution we kept an 8--by--8
Boolean matrix and update it each time we placed a queen, but that required linear time to update
as we need to check for safe cells.
Basically, we have to ensure 4 things:
1. No two queens share a column.
2. No two queens share a row.
3. No two queens share a top-right to left-bottom diagonal.
4. No two queens share a top-left to bottom-right diagonal.
Number 1 is automatic because of the way we store the solution. For number 2, 3 and 4, we can
perform updates in O(1) time. The idea is to keep three Boolean arrays that tell us which rows and
which diagonals are occupied.
Algorithm:
//Placing an Queen in k row and i column
Output:
Conclusion:
In this assignment we have successfully implemented the N-Queens problem using backtracking
and branch and bound
Assignment 5:
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language: C++, Java, Python
Software: Visual Studio Code, IntelliJ
Theory:
What is a Chatbot?
A chatbot is an AI-based software designed to interact with humans in their natural languages.
These chatbots are usually converse via auditory or textual methods, and they can effortlessly
mimic human languages to communicate with human beings in a human-like manner. A chatbot
is arguably one of the best applications of natural language processing. The Rule-based approach
trains a chatbot to answer questions based on a set of pre-determined rules on which it was initially
trained. These set rules can either be very simple or very complex. While rule-based chatbots can
handle simple queries quite well, they usually fail to process more complicated queries/requests.
As the name suggests, self-learning bots are chatbots that can learn on their own. These leverage
advanced technologies like Artificial Intelligence and Machine Learning to train themselves from
instances and behaviors. Naturally, these chatbots are much smarter than rule-based bots. Self-
learning bots can be further divided into two categories – Retrieval Based or Generative.
1. Retrieval-based Chatbots:
A retrieval-based chatbot is one that functions on predefined input patterns and set responses.
Once the question/pattern is entered, the chatbot uses a heuristic approach to deliver the
appropriate response. The retrieval-based model is extensively used to design goal-oriented
chatbots with customized features like the flow and tone of the bot to enhance the customer
experience.
2. Generative Chatbots :
Unlike retrieval-based chatbots, generative chatbots are not based on predefined responses – they
leverage seq2seq neural networks. This is based on the concept of machine translation where the
source code is translated from one language to another language. In seq2seq approach, the input
is transformed into an output. The first chatbot dates back to 1966 when Joseph Weizenbaum
created ELIZA that could imitate the language of a psychotherapist in only 200 lines of code.
However, thanks to the rapid advancement of technology, we’ve come a long way from scripted
chatbots to chatbots in python today.
Chatbot in Today’s Generation:
Today, we have smart AI-powered Chatbots that use natural language processing (NLP) to
understand human commands (text and voice) and learn from experience. Chatbots have become
a staple customer interaction tool for companies and brands that have an active online presence
(website and social network platforms). Chatbots using python are a nifty tool since they facilitate
instant messaging between the brand and the customer. Think about Apple’s Siri, Amazon’s
Alexa, and Microsoft’s Cortana. Aren’t these just wonderful? Aren’t you already curious to learn
how to make a chatbot in Python? ChatterBot is a Python library that is designed to deliver
automated responses to user inputs. It makes use of a combination of ML algorithms to generate
many different types of responses. This feature allows developers to build chatbots using python
that can converse with humans and deliver appropriate and relevant responses. Not just that, the
ML algorithms help the bot to improve its performance with experience. Another excellent feature
of ChatterBot is its language independence. The library is designed in a way that makes it possible
to train your bot in multiple programming languages.
How does ChatterBot function?
When a user enters a specific input in the chatbot (developed on ChatterBot), the bot saves the
input along with the response, for future use. This data (of collected experiences) allows the
chatbot to generate automated responses each time a new input is fed into it.
The program chooses the most-fitting response from the closest statement that matches the input,
and then delivers a response from the already known selection of statements and responses. Over
time, as the chatbot engages in more interactions, the accuracy of response improves.
Algorithm:
#Import Classes
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
# Create and Train the Chatbot
my_bot = ChatBot
(name='PyBot',read_onsly=True,logic_adapter=['chatterbot.logic.MathematicalEvaluation',
'chatterbot.logic.BestMatch'])
small_talk=['hi there',
'hi', 'how do you do',
'how are you',
'I am cool',
'I\'m fine',
'glad to hear that']
math_talk1= ['pythagorean theorem',
'a square plus b square equal c square']
math_talk2 = ['law of cosine', 'c**2=a**2+b**2-2*a*b*cos(gamma)']
list_trainer = ListTrainer(my_bot)
for item in(small_talk, math_talk1, math_talk2):
list_trainer.train(item)
#Communicate with the Python Chatbot
print(my_bot.get_response("hi"))
print(my_bot.get_response("how are you"))
print(my_bot.get_response("pythagorean theorem"))
Output:
Conclusion:
Objective: To understand the use of Expert system for Hospital and Medical
Facilities.
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language: C++, Java, Python
Software: Visual Studio Code, IntelliJ
Theory:
What is an Expert System?
In artificial intelligence (AI), an expert system is a computer-based decision-making system. It is
designed to solve complex problems. To do so, it applies knowledge and logical reasoning and
adheres to certain rules. An expert system is one of the first successful forms of artificial
intelligence
Algorithm:
from pyknow import *
diseases_list = []
diseases_symptoms = []
symptom_map = {}
d_desc_map = {}
d_treatment_map = {}
def preprocess():
global diseases_list,diseases_symptoms,symptom_map,d_desc_map,d_treatment_map
diseases = open("diseases.txt")
diseases_t = diseases.read()
diseases_list = diseases_t.split("\n")
diseases.close()
for disease in diseases_list:
disease_s_file = open("Disease symptoms/" + disease + ".txt")
disease_s_data = disease_s_file.read()
s_list = disease_s_data.split("\n")
diseases_symptoms.append(s_list)
symptom_map[str(s_list)] = disease
disease_s_file.close()
disease_s_file = open("Disease descriptions/" + disease + ".txt")
disease_s_data = disease_s_file.read()
d_desc_map[disease] = disease_s_data
disease_s_file.close()
disease_s_file = open("Disease treatments/" + disease + ".txt")
disease_s_data = disease_s_file.read()
d_treatment_map[disease] = disease_s_data
disease_s_file.close()
def identify_disease(*arguments):
symptom_list = []
for symptom in arguments:
symptom_list.append(symptom)
# Handle key error
return symptom_map[str(symptom_list)]
def get_details(disease):
return d_desc_map[disease]
def get_treatments(disease):
return d_treatment_map[disease]
def if_not_matched(disease):
print("")
id_disease = disease
disease_details = get_details(id_disease)
treatments = get_treatments(id_disease)
print("")
print("The most probable disease that you have is %s\n" %(id_disease))
print("A short description of the disease is given below :\n")
print(disease_details+"\n")
print("The common medications and procedures suggested by other real doctors
are: \n")
print(treatments+"\n")
@Rule(Fact(action='find_disease'), NOT(Fact(headache=W())),salience = 1)
def symptom_0(self):
self.declare(Fact(headache=input("headache: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(back_pain=W())),salience = 1)
def symptom_1(self):
self.declare(Fact(back_pain=input("back pain: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(chest_pain=W())),salience = 1)
def symptom_2(self):
self.declare(Fact(chest_pain=input("chest pain: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(cough=W())),salience = 1)
def symptom_3(self):
self.declare(Fact(cough=input("cough: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(fainting=W())),salience = 1)
def symptom_4(self):
self.declare(Fact(fainting=input("fainting: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(fatigue=W())),salience = 1)
def symptom_5(self):
self.declare(Fact(fatigue=input("fatigue: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(sunken_eyes=W())),salience = 1)
def symptom_6(self):
self.declare(Fact(sunken_eyes=input("sunken eyes: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(low_body_temp=W())),salience = 1)
def symptom_7(self):
self.declare(Fact(low_body_temp=input("low body temperature: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(restlessness=W())),salience = 1)
def symptom_8(self):
self.declare(Fact(restlessness=input("restlessness: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(sore_throat=W())),salience = 1)
def symptom_9(self):
self.declare(Fact(sore_throat=input("sore throat: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(fever=W())),salience = 1)
def symptom_10(self):
self.declare(Fact(fever=input("fever: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(nausea=W())),salience = 1)
def symptom_11(self):
self.declare(Fact(nausea=input("Nausea: ")))
@Rule(Fact(action='find_disease'), NOT(Fact(blurred_vision=W())),salience = 1)
def symptom_12(self):
self.declare(Fact(blurred_vision=input("blurred_vision: ")))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="no"),Fact(che
st_pain="no"),Fact(cough="no"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="yes"
),Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="yes"),Fact(sunken_eyes="no"
),Fact(nausea="yes"),Fact(blurred_vision="no"))
def disease_0(self):
self.declare(Fact(disease="Jaundice"))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="no"),Fact(che
st_pain="no"),Fact(cough="no"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="no"),
Fact(restlessness="yes"),Fact(low_body_temp="no"),Fact(fever="no"),Fact(sunken_eyes="no"),
Fact(nausea="no"),Fact(blurred_vision="no"))
def disease_1(self):
self.declare(Fact(disease="Alzheimers"))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="yes"),Fact(che
st_pain="no"),Fact(cough="no"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="yes"
),Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="no"),Fact(sunken_eyes="no")
,Fact(nausea="no"),Fact(blurred_vision="no"))
def disease_2(self):
self.declare(Fact(disease="Arthritis"))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="no"),Fact(che
st_pain="yes"),Fact(cough="yes"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="no
"),Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="yes"),Fact(sunken_eyes="no
"),Fact(nausea="no"),Fact(blurred_vision="no"))
def disease_3(self):
self.declare(Fact(disease="Tuberculosis"))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="no"),Fact(che
st_pain="yes"),Fact(cough="yes"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="no
"),Fact(restlessness="yes"),Fact(low_body_temp="no"),Fact(fever="no"),Fact(sunken_eyes="no
"),Fact(nausea="no"),Fact(blurred_vision="no"))
def disease_4(self):
self.declare(Fact(disease="Asthma"))
@Rule(Fact(action='find_disease'),Fact(headache="yes"),Fact(back_pain="no"),Fact(che
st_pain="no"),Fact(cough="yes"),Fact(fainting="no"),Fact(sore_throat="yes"),Fact(fatigue="no
"),Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="yes"),Fact(sunken_eyes="no
"),Fact(nausea="no"),Fact(blurred_vision="no"))
def disease_5(self):
self.declare(Fact(disease="Sinusitis"))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="no"),Fact(che
st_pain="no"),Fact(cough="no"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="yes"
),Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="no"),Fact(sunken_eyes="no")
,Fact(nausea="no"),Fact(blurred_vision="no"))
def disease_6(self):
self.declare(Fact(disease="Epilepsy"))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="no"),Fact(che
st_pain="yes"),Fact(cough="no"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="no"
),Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="no"),Fact(sunken_eyes="no")
,Fact(nausea="yes"),Fact(blurred_vision="no"))
def disease_7(self):
self.declare(Fact(disease="Heart Disease"))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="no"),Fact(che
st_pain="no"),Fact(cough="no"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="yes"
),Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="no"),Fact(sunken_eyes="no")
,Fact(nausea="yes"),Fact(blurred_vision="yes"))
def disease_8(self):
self.declare(Fact(disease="Diabetes"))
@Rule(Fact(action='find_disease'),Fact(headache="yes"),Fact(back_pain="no"),Fact(che
st_pain="no"),Fact(cough="no"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="no"),
Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="no"),Fact(sunken_eyes="no"),
Fact(nausea="yes"),Fact(blurred_vision="yes"))
def disease_9(self):
self.declare(Fact(disease="Glaucoma"))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="no"),Fact(che
st_pain="no"),Fact(cough="no"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="yes"
),Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="no"),Fact(sunken_eyes="no")
,Fact(nausea="yes"),Fact(blurred_vision="no"))
def disease_10(self):
self.declare(Fact(disease="Hyperthyroidism"))
@Rule(Fact(action='find_disease'),Fact(headache="yes"),Fact(back_pain="no"),Fact(che
st_pain="no"),Fact(cough="no"),Fact(fainting="no"),Fact(sore_throat="no"),Fact(fatigue="no"),
Fact(restlessness="no"),Fact(low_body_temp="no"),Fact(fever="yes"),Fact(sunken_eyes="no"),
Fact(nausea="yes"),Fact(blurred_vision="no"))
def disease_11(self):
self.declare(Fact(disease="Heat Stroke"))
@Rule(Fact(action='find_disease'),Fact(headache="no"),Fact(back_pain="no"),Fact(che
st_pain="no"),Fact(cough="no"),Fact(fainting="yes"),Fact(sore_throat="no"),Fact(fatigue="no"
),Fact(restlessness="no"),Fact(low_body_temp="yes"),Fact(fever="no"),Fact(sunken_eyes="no"
),Fact(nausea="no"),Fact(blurred_vision="no"))
def disease_12(self):
self.declare(Fact(disease="Hypothermia"))
@Rule(Fact(action='find_disease'),Fact(disease=MATCH.disease),salience = -998)
def disease(self, disease):
print("")
id_disease = disease
disease_details = get_details(id_disease)
treatments = get_treatments(id_disease)
print("")
print("The most probable disease that you have is %s\n" %(id_disease))
print("A short description of the disease is given below :\n")
print(disease_details+"\n")
print("The common medications and procedures suggested by other real doctors
are: \n")
print(treatments+"\n")
@Rule(Fact(action='find_disease'),
Fact(headache=MATCH.headache),
Fact(back_pain=MATCH.back_pain),
Fact(chest_pain=MATCH.chest_pain),
Fact(cough=MATCH.cough),
Fact(fainting=MATCH.fainting),
Fact(sore_throat=MATCH.sore_throat),
Fact(fatigue=MATCH.fatigue),
Fact(low_body_temp=MATCH.low_body_temp),
Fact(restlessness=MATCH.restlessness),
Fact(fever=MATCH.fever),
Fact(sunken_eyes=MATCH.sunken_eyes),
Fact(nausea=MATCH.nausea),
Fact(blurred_vision=MATCH.blurred_vision),NOT(Fact(disease=MATCH.disease)),sa
lience = -999)
if __name__ == "__main__":
preprocess()
engine = Greetings()
while(1):
engine.reset() # Prepare the engine for the execution.
engine.run() # Run it!
print("Would you like to diagnose some other symptoms?")
if input() == "no":
exit()
#print(engine.facts)
Output:
Conclusion:
In this assignment we have successfully implemented the Expert System of Hospitals and Medical
facilities.
“Techno – Social Excellence”
Marathwada Mitramandal’s
INSTITUTE OF TECHNOLOGY
Lohgaon, Pune-411047
LAB MANUAL
LP-II TE COMP
(2019 Pattern)
(Part 2)
Prepared By:
Dr. Mangesh D. Salunke
Prof. Suhas R. Kothavle
Savitribai Phule Pune University
Third Year of Computer Engineering (2019 Course) Home
#6/99
http://collegecirculars.unipune.ac.in/sites/documents/Syllabus2021/Forms/AllItems.aspx
Savitribai Phule Pune University
Third Year of Computer Engineering (2019 Course) Home
310258:Laboratory Practice II
Teaching Scheme Credit: 02 Examination Scheme and
Practical: 04 Marks Term Work: 50 Marks
Hours/Week Practical: 25 Marks
Companion Course: Artificial Intelligence (310253), Elective II (310254)
Course Objectives:
● To learn and apply various search strategies for AI
● To Formalize and implement constraints in search problems
● To understand the concepts of Information Security / Augmented and Virtual
Reality/Cloud Computing/Software Modeling and Architectures
Course Outcomes:
On completion of the course, learner will be able to
● Artificial Intelligence
CO1: Design a system using different informed search / uninformed search or
heuristic approaches
CO2: Apply basic principles of AI in solutions that require problem solving,
inference, perception, knowledge representation, and learning
CO3: Design and develop an interactive AI application
● Information Security
CO4: Use tools and techniques in the area of Information
Security CO5: Use the cryptographic techniques for problem
solving CO6: Design and develop security solution
OR
● Augmented and Virtual Reality
CO4: Use tools and techniques in the area of Augmented and Virtual Reality
CO5: Use the representing and rendering system for problem solving
CO6: Design and develop ARVR applications
OR
● Cloud Computing
CO4: Use tools and techniques in the area of Cloud Computing
CO5: Use cloud computing services for problem solving
CO6: Design and develop applications on cloud
OR
program listing to journal must be avoided. Use of DVD containing students programs maintained by
Laboratory In-charge is highly encouraged. For reference one or two journals may be maintained with
program prints in the Laboratory.
Guidelines for Laboratory /Term Work Assessment
Continuous assessment of laboratory work should be based on overall performance of Laboratory
assignments by a student. Each Laboratory assignment assessment will assign grade/marks based on
parameters, such as timely completion, performance, innovation, efficient codes, punctuality and
Guidelines for Practical Examination
Problem statements must be decided jointly by the internal examiner and external examiner. During
practical assessment, maximum weightage should be given to satisfactory implementation of the
problem statement. Relevant questions may be asked at the time of evaluation to test the student‘s
understanding of the fundamentals, effective and efficient implementation. This will encourage,
transparent evaluation and fair approach, and hence will not create any uncertainty or doubt in the
minds of the students. So, adhering to these principles will consummate our team efforts to the
promising start of student's academics.
Guidelines for Laboratory Conduction
The instructor is expected to frame the assignments by understanding the prerequisites, technological
aspects, utility and recent trends related to the topic. The assignment framing policy need to address
the average students and inclusive of an element to attract and promote the intelligent students. Use
of open source software is encouraged. Based on the concepts learned. Instructor may also set one
assignment or mini-project that is suitable to respective branch beyond the scope of syllabus.
Operating System recommended :- 64-bit Windows OS and
Linux Programming tools recommended: -
Information Security : - C/C++/Java
Augmented and Virtual Reality :- Unity, C#, Blender, VRTK, ARTK, Vuforia
VR Devices: HTC Vive, Google Daydream and Samsung gear
VR. Software Modeling and Architectures:-Front end:HTML5, Bootstarp, JQuery, JS etc.
Backend: MySQL /MongoDB/NodeJS
Virtual Laboratory:
Software Modeling and Architectures : http://vlabs.iitkgp.ernet.in/se
Information Security : http://cse29-iiith.vlabs.ac.in
Part I : Artificial Intelligence
Suggested List of Laboratory Experiments/Assignments
Sr. Group A
No.
All assignments are compulsory
1. Implement depth first search algorithm and Breadth First Search algorithm, Use an
undirected
graph and develop a recursive algorithm for searching all the vertices of a graph or tree data
structure.
3. Consider the online shopping system in the assignment 2. Draw the sequence diagram using
UML tool to show message exchanges
4. Consider your neighboring travel agent from whom you can purchase flight tickets. To book
a ticket you need to provide details about your journey i.e., on which date and at what time
you would like to travel. You also need to provide your address. The agency has recently
been modernized. So, you can pay either by cash or by card. You can also cancel a booked
ticket later if you decide to change your plan. In that case you need to book a new ticket again.
Your agent also allows you to book a hotel along with flight ticket. While cancelling a flight
ticket you can also cancel hotel booking. Appropriate refund as per policy is made in case of
cancellation.
Perform the following tasks and draw the use case diagram using UML tool.
d. Identify the use cases from a given non-trivial problem statement.
e. Identify the primary and secondary actors for a system.
f. Use to generalization of use cases and «include» stereotypes to prevent
redundancy in the coding phase
Mini-Projects
5. Select a moderately complex system and narrate concise requirement Specification for the
same. Design the system indicating system elements organizations using applicable
architectural styles and design patterns with the help of a detailed Class diagram depicting
logical architecture. Specify and document the architecture and design pattern with the help
of templates. Implement the system features and judge the benefits of the design patterns
accommodated.
Learning Resources
Text Books:
Artificial Intelligence
1. 1.Stuart Russell and Peter Norvig, “Artificial Intelligence: A Modern Approach”, Third
edition, Pearson, 2003, ISBN :10: 0136042597
2. Deepak Khemani, “A First Course in Artificial Intelligence”, McGraw Hill
Education(India), 2013, ISBN : 978-1-25-902998-1
3. Elaine Rich, Kevin Knight and Nair, “Artificial Intelligence”, TMH, ISBN-978-0-07-
008770-5
Information Security
1. Atul Kahate, “Cryptography and Network Security”, 3e, McGraw Hill Education
2. Prakash C. Gupta, “Cryptography and Network Security”, PHI
3. V.K. Pachghare, “Cryptography and Information Security”, PHI Learning
Cloud Computing
1. Srinivasan, J. Suresh,” Cloud Computing: A Practical Approach for Learning and
Implementation”, Pearson, ISBN: 978-81-317-7651-3
2. Rajkumar Buyya, Christian Vecchiola, S. Thamarai Selvi, “Mastering Cloud
Computing”, McGraw Hill Education, ISBN-13:978-1-25-902995-0
Augmented and Virtual Reality
1. William R Sherman and Alan B Craig, “Understanding Virtual Reality: Interface,
Application and Design”, (The Morgan Kaufmann Series in Computer Graphics)”. Morgan
Kaufmann Publishers, San Francisco, CA, 2002
2. Alan B Craig, “Understanding Augmented Reality, Concepts and Applications”, Morgan
Kaufmann Publishers, ISBN:978-0240824086
Software Modeling and Architectures
1. Jim Arlow, Ila Neustadt, “UML 2 and the unified process –practical object-oriented
analysis and design”, Addison Wesley, Second edition, ISBN 978-0201770605
2. Len Bass, Paul Clements, Rick Kazman, ''Software Architecture in Practice", Second
Edition, Pearson ,ISBN 978-81-775-8996-2
3. Hassan Gomaa, “Software Modeling and Design- UML, Use cases, Patterns and Software
Architectures”, Cambridge University Press, 2011, ISBN 978-0-521-76414-8
4. Erich Gamma, “Design Patterns”, Pearson, ISBN 0-201-63361-2
Reference Books:
1. Nilsson Nils J , “Artificial Intelligence: A new Synthesis”, Morgan Kaufmann Publishers
Inc. San Francisco, CA, ISBN: 978-1-55-860467-4
2. Patrick Henry Winston, “Artificial Intelligence”, Addison-Wesley Publishing Company,
ISBN: 0- 201-53377-4
3. Andries P. Engelbrecht, “Computational Intelligence: An Introduction”, 2nd Edition-Wiley
India-
ISBN: 978-0-470-51250-0
Information Security
1. William Stallings, Lawrie Brown, “Computer Security Principles and Practice”, 3rd_Edition,
Pearson
2. William Stallings, “Cryptography and Network Security Principals and Practice”, Fifth edition,
Pearson
3. Nina Godbole, Sunit Belapure, “Cyber Security”, Wiley, ISBN: 978-81-265-2179-1
Augmented and Virtual Reality
1. Steven M. LaValle, “Virtual Reality”, Cambridge University Press, 2016
2. Alan B Craig, William R Sherman and Jeffrey D Will, “Developing Virtual Reality Applications:
Foundations of Effective Design”, Morgan Kaufmann, 2009.
3. Schmalstieg / Hollerer, “Augmented Reality: Principles & Practice”, Pearson Education India; First
edition (12 October 2016),ISBN-10: 9332578494
Cloud Computing
1. James Bond ,“The Enterprise Cloud”, O'Reilly Media, Inc. ISBN: 9781491907627
2. Dr. Kris Jamsa, “Cloud Computing: SaaS, PaaS, IaaS, Virtualization and more”, Wiley Publications,
ISBN: 978-0-470-97389-9
3. Anthony T. Velte Toby J. Velte, Robert Elsenpeter, “Cloud Computing: A Practical Approach”, 2010,
The McGraw-Hill.
Software Modeling and Architectures
1. Gardy Booch, James Rambaugh, Ivar Jacobson, “The unified modeling language user guide” , Pearson
Education, Second edition, 2008, ISBN 0-321-24562-8.
2. Lan Sommerville, “Software Engineering”, 9th edition, ISBN-13: 978-0-13-703515-1 ISBN-10: 0- 13-
703515-2.
AIM:
Write a Java/C/C++/Python program that contains a string (char pointer) with a value
\HelloWorld’. The program should AND and XOR each character in this string with127 and
display the result.
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Eclipse
Theory:
The AND gate is an electronic circuit that gives a high output(1) only if all the inputs are
high. A dot(.) is used to show the AND operation i.e. A.B this dot is sometimes omitted.
ALGORITHM:
1. start
2. take the input ‘hello world’ which is assigned to variable ‘str’
3.perform AND operation between the string and 127.
4. then print the result
5. Stop.
Output:
Conclusion: Thus we have studied XOR and AND gate operation on string to identify the
encryption and decryption process.
Assignment no. 3
Aim:
Write a Java/C/C++/Python program to implement DES algorithm.
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Eclipse
Theory:
Data encryption standard (DES) has been found vulnerable against very powerful
attacks and therefore, the popularity of DES has been found slightly on the decline.
DES is a block cipher and encrypts data in blocks of size of 64 bits each, which means
64 bits of plain text goes as the input to DES, which produces 64 bits of ciphertext. The same
algorithm and key are used for encryption and decryption, with minor differences. The key
length is 56 bits. The basic idea is shown in the figure.
We have mentioned that DES uses a 56-bit key. Actually, the initial key consists of 64
bits. However, before the DES process even starts, every 8th bit of the key is discarded to
produce a 56-bit key. That is bit positions 8, 16, 24, 32, 40, 48, 56, and 64 are discarded.
Thus, the discarding of every 8th bit of the key produces a 56-bit key from the original 64-bit
key.
DES is based on the two fundamental attributes of cryptography: substitution (also called
confusion) and transposition (also called diffusion). DES consists of 16 steps, each of which is
called a round. Each round performs the steps of substitution and transposition. Let us now
discuss the broad-level steps in DES.
1. In the first step, the 64-bit plain text block is handed over to an initial Permutation
(IP) function.
2. The initial permutation is performed on plain text.
3. Next, the initial permutation (IP) produces two halves of the permuted block; says
Left Plain Text (LPT) and Right Plain Text (RPT).
4. Now each LPT and RPT go through 16 rounds of the encryption process.
5. In the end, LPT and RPT are rejoined and a Final Permutation (FP) is performed
on the combined block
6. The result of this process produces 64-bit ciphertext.
As we have noted, the initial permutation (IP) happens only once and it
happens before the first round. It suggests how the transposition in IP should proceed, as shown
in the figure.
For example, it says that the IP replaces the first bit of the original plain text block with the
58th bit of the original plain text, the second bit with the 50th bit of the original plain text block,
and so on.
This is nothing but jugglery of bit positions of the original plain text block. the same rule
applies to all the other bit positions shown in the figure.
As we have noted after IP is done, the resulting 64-bit permuted text block is divided into two
half blocks. Each half-block consists of 32 bits, and each of the 16 rounds, in turn, consists of
the broad level steps outlined in the figure.
We have noted initial 64-bit key is transformed into a 56-bit key by discarding
every 8th bit of the initial key. Thus, for each a 56-bit key is available. From this 56-bit key, a
different 48-bit Sub Key is generated during each round using a process called key
transformation. For this, the 56-bit key is divided into two halves, each of 28 bits. These halves
are circularly shifted left by one or two positions, depending on the round.
For example, if the round numbers 1, 2, 9, or 16 the shift is done by only position for other
rounds, the circular shift is done by two positions. The number of key bits shifted per round is
shown in the figure.
After an appropriate shift, 48 of the 56 bits are selected. for selecting 48 of the 56 bits the table
is shown in the figure given below. For instance, after the shift, bit number 14 moves on the
first position, bit number 17 moves on the second position, and so on. If we observe the table
carefully, we will realize that it contains only 48-bit positions. Bit number 18 is discarded (we
will not find it in the table), like 7 others, to reduce a 56-bit key to a 48-bit key. Since the key
transformation process involves permutation as well as a selection of a 48-bit subset of the
original 56-bit key it is called Compression Permutation.
Because of this compression permutation technique, a different subset of key bits is used in
each round. That makes DES not easy to crack.
Recall that after initial permutation, we had two 32-bit plain text areas called Left Plain
Text(LPT) and Right Plain Text(RPT). During the expansion permutation, the RPT is
expanded from 32 bits to 48 bits. Bits are permuted as well hence called expansion permutation.
This happens as the 32-bit RPT is divided into 8 blocks, with each block consisting of 4 bits.
Then, each 4-bit block of the previous step is then expanded to a corresponding 6-bit block,
i.e., per 4-bit block, 2 more bits are added.
This process results in expansion as well as a permutation of the input bit while creating output.
The key transformation process compresses the 56-bit key to 48 bits. Then the expansion
permutation process expands the 32-bit RPT to 48-bits. Now the 48-bit key is XOR with 48-
bit RPT and the resulting output is given to the next step, which is the S-Box substitution.
Python Program:
def hex2bin(s):
mp = {'0' : "0000",
'1' : "0001",
'2' : "0010",
'3' : "0011",
'4' : "0100",
'5' : "0101",
'6' : "0110",
'7' : "0111",
'8' : "1000",
'9' : "1001",
'A' : "1010",
'B' : "1011",
'C' : "1100",
'D' : "1101",
'E' : "1110",
'F' : "1111" }
bin = ""
for i in
range(len(s)): bin
= bin + mp[s[i]]
return bin
def bin2hex(s):
mp = {"0000" : '0',
"0001" : '1',
"0010" : '2',
"0011" : '3',
"0100" : '4',
"0101" : '5',
"0110" : '6',
"0111" : '7',
"1000" : '8',
"1001" : '9',
"1010" : 'A',
"1011" : 'B',
"1100" : 'C',
"1101" : 'D',
"1110" : 'E',
"1111" : 'F' }
hex = ""
for i in
range(0,len(s),4): ch
= ""
ch = ch + s[i]
ch = ch + s[i +
1] ch = ch + s[i
+ 2] ch = ch + s[i
+ 3] hex = hex +
mp[ch]
return hex
def bin2dec(binary):
binary1 = binary
decimal, i, n = 0, 0,
0
while(binary != 0):
dec = binary %
10
i += 1
return decimal
def dec2bin(num):
if(len(res)%4 != 0):
div = len(res) /
4
div = int(div)
for i in range(0,
counter): res = '0' +
res
return res
return permutation
# shifting the bits towards left by nth shifts
def shift_left(k,
nth_shifts): s = ""
for i in range(nth_shifts):
for j in
range(1,len(k)): s
= s + k[j]
s = s +
k[0] k = s
s = ""
return k
def xor(a,
b): ans =
""
for i in range(len(a)):
if a[i] == b[i]:
ans = ans +
"0"
else:
ans = ans + "1"
return ans
initial_perm = [58, 5 4 3 2 1 1 2
0, 2, 4, 6, 8, 0, ,
60, 5 4 3 2 2 1 4
2, 4, 6, 8, 0, 2, ,
62, 5 4 3 3 2 1 6
4, 6, 8, 0, 2, 4, ,
64, 5 4 4 3 2 1 8
6, 8, 0, 2, 4, 6, ,
57, 49, 41, 33, 25, 17, 9, 1,
59, 5 4 3 2 1 1 3
1, 3, 5, 7, 9, 1, ,
61, 5 4 3 2 2 1 5
3, 5, 7, 9, 1, 3, ,
63, 5 4 3 3 2 1 7
5, 7, 9, 1, 3, 5, ]
# Expansion D-box Table
exp_d = [32, 1 , 2 , 3 , 4 , 5 , 4 , 5,
6 , 7 , 8 , 9 , 8 , 9 , 10, 11,
1 1 1 1 1 1 1 1
2, 3, 2, 3, 4, 5, 6, 7,
1 1 1 1 2 2 2 2
6, 7, 8, 9, 0, 1, 0, 1,
2 2 2 2 2 2 2 2
2, 3, 4, 5, 4, 5, 6, 7,
2 2 2 2 3 3 3 1
8, 9, 8, 9, 0, 1, 2, ]
per = [ 1 7, 2 21,
6, 0,
2 1 2 17,
9, 2, 8,
1, 1 2 26,
5, 3,
5, 1 3 10,
8, 1,
2, 8, 2 14,
4,
3 2 3, 9,
2, 7,
1 1 3 6,
9, 3, 0,
2 1 4, 25
2, 1, ]
# S-box Table
final_perm = [ 40, 8 4 1 5 2 6 3
, 8, 6, 6, 4, 4, 2,
39, 7 4 1 5 2 6 3
, 7, 5, 5, 3, 3, 1,
38, 6 4 1 5 2 6 3
, 6, 4, 4, 2, 2, 0,
37, 5 4 1 5 2 6 2
, 5, 3, 3, 1, 1, 9,
36, 4 4 1 5 2 6 2
, 4, 2, 2, 0, 0, 8,
35, 3 4 1 5 1 5 2
, 3, 1, 1, 9, 9, 7,
34, 2 4 1 5 1 5 2
, 2, 0, 0, 8, 8, 6,
33, 1, 41, 9, 49, 17, 57, 25 ]
# Initial Permutation
# Splitting
left =
pt[0:32]
right = pt[32:64]
sbox_str = ""
val = sbox[j][row][col]
# Swapper
if(i != 15):
# Combination
return cipher_text
pt =
"123456ABCD132536" key
= "AABB09182736CCDD"
# Key
generation # --
hex to binary
key = hex2bin(key)
# Splitting
rkb = []
rk = []
rkb.append(round_key)
rk.append(bin2hex(round_key))
print("Encryption")
print("Decryption
") rkb_rev =
rkb[::-1] rk_rev
= rk[::-1]
Output:
Conclusion : Thus we have studied encryption and decryption using DES algorithm
Assignment No. 4
Aim:
Write a Java/C/C++/Python program to implement AES Algorithm
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Eclipse
Theory:
Advanced Encryption Standard (AES) is a specification for the encryption of electronic data
established by the U.S National Institute of Standards and Technology (NIST) in 2001. AES is
widely used today as it is a much stronger than DES and triple DES despite being harder to
implement.
Points to remember
Encryption :
AES considers each block as a 16 byte (4 byte x 4 byte = 128 ) grid in a column major
arrangement.
● SubBytes
● ShiftRows
● MixColumns
● Add Round Key
The last round doesn’t have the MixColumns round.
The SubBytes does the substitution and ShiftRows and MixColumns performs the permutation
in the algorithm.
SubBytes :
This step implements the substitution.
In this step each byte is substituted by another byte.(Its performed using a lookup table also
called the S-box.This substitution is done in a way that a byte is never substituted by itself and
also not substituted by another byte which is a compliment of the current byte.The result of this
step is a 16 byte (4 x 4 ) matrix like before.
ShiftRows :
This step is just as it sounds. Each row is shifted a particular number of times.
MixColumns :
This step is basically a matrix multiplication. Each column is multiplied with a specific matrix
and thus the position of each byte in the column is changed as a result.
Now the resultant output of the previous stage is XOR-ed with the corresponding round key.
Here, the 16 bytes is not considered as a grid but just as 128 bits of data.
After all these rounds 128 bits of encrypted data is given back as output. This process is
repeated until all the data to be encrypted undergoes this process.
Decryption :
The stages in the rounds can be easily undone as these stages have an opposite to it which when
performed reverts the changes.Each 128 blocks goes through the 10,12 or 14 rounds depending
on the key size.
Inverse SubBytes :
Inverse S-box is used as a lookup table and using which the bytes are substituted during
decryption.
C Program:
#include
<stdio.h>
/*
#include <mcrypt.h>
#include <math.h>
int encrypt(
void* buffer,
int key_len
){
mcrypt_generic_deinit (td);
mcrypt_module_close(td);
return 0;
int decrypt(
void* buffer,
int
buffer_len,
char* IV,
char* key,
int key_len
){
mcrypt_module_close(td);
return 0;
printf("\n");
int main()
char* key =
"0123456789abcdef"; int
keysize = 16; /* 128 bits */
char* buffer;
printf("==C==\n");
return 0;
Conclusion: Thus we have studied encryption and decryption using AES algorithm
Assignment no. 5
Aim:
Write a Java/C/C++/Python program to implement RSA algorithm
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Eclipse
Theory:
RSA (Rivest–Shamir–Adleman) algorithm is asymmetric cryptography algorithm. The
acronym "RSA" comes from the surnames of Ron Rivest, Adi Shamir and Leonard Adleman,
who publicly described the algorithm in 1977.Asymmetric actually means that it works on two
different keys i.e. Public Key and Private Key. As the name describes that the Public Key is
given to everyone and Private key is kept private.
An example of asymmetric cryptography :
1. A client (for example browser) sends its public key to the server and requests for
some data.
2. The server encrypts the data using client’s public key and sends the encrypted
data.
3. Client receives this data and decrypts it.
Since this is asymmetric, nobody else except browser can decrypt the data even if a third party
has public key of browser.
The idea! The idea of RSA is based on the fact that it is difficult to factorize a large integer.
The public key consists of two numbers where one number is multiplication of two large prime
numbers. And private key is also derived from the same two prime numbers. So, if somebody
can factorize the large number, the private key is compromised. Therefore, encryption strength
totally lies on the key size and if we double or triple the key size, the strength of encryption
increases exponentially. RSA keys can be typically 1024 or 2048 bits long, but experts believe
that 1024-bit keys could be broken in the near future. But till now it seems to be an infeasible
task.
a. Now we are ready with our – Public Key ( n = 3127 and e = 3) and Private
Key(d = 2011)
b. Now we will encrypt “HI” : 16.Convert
letters to numbers : H = 8 and I = 9 17.
18. Thus Encrypted Data c = 89e mod n.
19. Thus our Encrypted Data comes out to be 1394 20.
21.Now we will decrypt 1394 :
22.
23. Decrypted Data = cd mod n.
24. Thus our Encrypted Data comes out to be 89
25.8 = H and I = 9 i.e. "HI".
Program:
// application
#include<stdio.h>
#include<math.h>
// Returns gcd of a and b int gcd(int a, int h)
{
int temp;
while (1)
{
temp = a%h; if
(temp == 0) return
h;
a = h;
h = temp;
e++;
}
// Private key (d stands for decrypt)
// d*e = 1 + k * totient
return 0;
Output:
Implement the Diffie-Hellman Key Exchange mechanism using HTML and JavaScript.
Consider the end user as one of the parties (Alice) and the JavaScript application as other party
(bob).
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Eclipse
Theory:
The Diffie-Hellman algorithm is being used to establish a shared secret that can be used for
secret communications while exchanging data over a public network using the elliptic curve to
generate points and get the secret key using the parameters.
For the sake of simplicity and practical implementation of the algorithm, we will consider only
4 variables, one prime P and G (a primitive root of P) and two private values a and b.
P and G are both publicly available numbers. Users (say Alice and Bob) pick private values a
and b and they generate a key and exchange it publicly. The opposite person receives the key
and that generates a secret key, after which they have the same secret key to encrypt.
Step by Step Explanation
Alice Bob
Public Keys available = P, G Public Keys available = P, G
Example:
Step 1: Alice and Bob get public numbers P = 23, G = 9 Step 2: Alice
selected a private key a = 4 and
Bob selected a private key b = 3
Python Program:
# A prime number P is
taken P = 23
ka = int(pow(y,a,P))
Output:
Conclusion: Thus we have studied how to exchange keys using Diffie-Hellman key exchange.
“Techno – Social Excellence”
Marathwada Mitramandal’s
INSTITUTE OF TECHNOLOGY
Lohgaon, Pune-411047
LAB MANUAL
LP-II TE COMP
(2019 Pattern)
(Part 2)
Prepared By:
Prof. Subhash G. Rathod
INDEX
Part II : Cloud Computing
Case study on Microsoft azure to learn about Microsoft Azure is a cloud
computing platform and infrastructure, created by Microsoft, for building,
deploying and managing applications and services through a global network
1
of Microsoft-managed data centers.
OR
Case study on Amazon EC2 and learn about Amazon EC2 web services.
Installation and configure Google App Engine.
2 OR
Installation and Configuration of virtualization using KVM.
Creating an Application in SalesForce.com using Apex programming
3
Language.
Design and develop custom Application (Mini Project) using Sales force
4 Cloud.
Mini-Project
Setup your own cloud for Software as a Service (SaaS) over the existing
LAN in your laboratory. In this assignment you have to write your own code
5
for cloud controller using open- source technologies to implement with
HDFS. Implement the basic operations may be like to divide the file in
segments/blocks and upload/ download file on/from cloud in encrypted form.
Cloud Computing
Assignment No 1:
Aim/Title: Case study on Microsoft azure to learn about Microsoft Azure is a cloud
computing platform and infrastructure, created by Microsoft, for building,
deploying and managing applications and services through a global network of
Microsoft-managed data centres.
OR
Case study on Amazon EC2 and learn about Amazon EC2 web services
Objective:
1. To learn cloud computing environment.
2. To study how to use Microsoft Azure/Amazon EC2
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Intellij
Theory:
Windows Azure is one of them, which is provided by Microsoft. Azure can be described as the
managed data centers that are used to build, deploy, manage the applications and provide services
through a global network. The services provided by Microsoft Azure are PaaS and IaaS. Many
programming languages and frameworks are supported by it. Azure as PaaS (Platform as a
Service) As the name suggests, a platform is provided to clients to develop and deploy software.
The clients can focus on the application development rather than having to worry about hardware
and infrastructure. It also takes care of most of the operating systems, servers and networking
issues.
Pros
●The overall cost is low as the resources are allocated on demand and servers are automatically
updated.
● It is less vulnerable as servers are automatically updated and being checked for all known
security issues. The whole process is not visible to developer and thus does not pose a risk of data
breach.
● Since new versions of development tools are tested by the Azure team, it becomes easy for
developers to move on to new tools. This also helps the developers to meet the customer’s demand
by quickly adapting to new versions.
Cons
● There are portability issues with using PaaS. There can be a different environment at Azure,
thus the application might have to be adapted accordingly. Azure as IaaS (Infrastructure as a
Service) It is a managed compute service that gives complete control of the operating systems and
the application platform stack to the application developers. It lets the user to access, manage and
monitor the data centers by themselves.
● This is ideal for the application where complete control is required. The virtual machine can be
completely adapted to the requirements of the organization or business.
● IaaS facilitates very efficient design time portability. This means application can be migrated to
Windows Azure without rework. All the application dependencies such as database can also be
migrated to Azure.
● IaaS allows quick transition of services to clouds, which helps the vendors to offer services to
their clients easily. This also helps the vendors to expand their business by selling the existing
software or services in new markets. Azure Management Portal Azure Management Portal is an
interface to manage the services and infrastructure launched in 2012. All the services and
applications are displayed in it and it lets the user manage them. started A free trial account can
be created on Azure management portal by visiting the following link -
manage.windowsazure.com The screen that pops up is as shown in the following image. The
account can be created using our existing Gmail, Hotmail or Yahoo account. Compute / Execution
Models This is the interface for executing the application, which is one of the basic functions of
Azure.
Output:
Conclusion:
Thus, we saw in detail how to create an on-demand Azure instance in this tutorial. Because it is
an on-demand server, you can keep it running when in use and 'Stop' it when it's unused to save
on your costs
Assignment No 2:
Objective:
• To learn basic of Google App Engine.
• To install and configure Google App Engine.
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Intellij
Theory:
Google App Engine is a web application hosting service. By “web application,” we mean an
application or service accessed over the Web, usually with a web browser: storefronts with
shopping carts, social networking sites, multiplayer games, mobile applications, survey
applications, project management, collaboration, publishing, and all the other things we’re
discovering are good uses for the Web. App Engine can serve traditional website content too,
such as documents and images, but the environment is especially designed for real-time
dynamic applications. Of course, a web browser is merely one kind of client: web application
infrastructure is well suited to mobile applications, as well.
In particular, Google App Engine is designed to host applications with many
simultaneous users. When an application can serve many simultaneous users without degrading
performance, we say it scales. Applications written for App Engine scale automatically. As
more people use the application, App Engine allocates more resources for the application and
manages the use of those resources. The application itself does not need to know anything about
the resources it is using.
Google App Engine: It is a platform-as-a-service (PaaS) Cloud computing platform that is fully
managed and uses inbuilt services to run your apps. You can start development almost instantly
after downloading the software development kit (SDK). You can go on to the developer’s guide
right away when you click on the language you wish to develop your app in. As soon as you have
signed up for a Cloud account.
These are covered by the depreciation policy and the service-level agreement of the app engine.
Any changes made to such a feature are backward-compatible and implementation of such a
feature is usually stable. These include data storage, retrieval, and search; communications;
process management; computation; app configuration and management.
Output:
Conclusion:
Objective:
• To learn salesforce cloud administration.
• To create application in SalesForce.com using Apex programming.
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Intellij
Theory:
What is Apex?
Apex is a proprietary language developed by the Salesforce.com. As per the official definition,
Apex is a strongly typed, object-oriented programming language that allows developers to
execute the flow and transaction control statements on the Force.com platform server in
conjunction with calls to the Force.com API.
It has a Java-like syntax and acts like database stored procedures. It enables the developers to
add business logic to most system events, including button clicks, related record updates, and
Visual force pages. Apex code can be initiated by Web service requests and from triggers on
objects. Apex is included in Performance Edition, Unlimited Edition, Enterprise Edition, and
Developer edition.
Strongly Typed
Apex is a strongly typed language. It uses direct reference to schema objects like Object and any
invalid reference quickly fails if it is deleted or if is of wrong data type.
Multitenant Environment
Apex runs in a multitenant environment. Consequently, the Apex runtime engine is designed to
guard closely against runaway code, preventing it from monopolizing shared resources. Any
code that violates limits fails with easy-to-understand error messages.
Upgrades Automatically
Apex is upgraded as part of Salesforce releases. We don't have to upgrade it manually.
Easy Testing
Apex provides built-in support for unit test creation and execution, including test results that
indicate how much code is covered, and which parts of your code can be more efficient.
When Should Developer Choose Apex Apex code should only be written if a business scenario
is too complex and can’t be implemented using the pre-built functionality provided by
Salesforce
Following are the few scenarios where we need to write apex code:
● To create web services that integrate Salesforce with other applications.
● To implement custom validation on sobjects.
● To execute custom apex logic when a DML operation is performed.
● To implement functionality that can’t be implemented using existing workflows flows and
process builders functionality.
● To setup email services, you need to include processing the contents, headers, and
attachments of email using apex code.
● Developer Action: All the apex code written by a developer is compiled into a set of
instructions that can be understood by apex runtime interpreter when the developer saves the
code to the platform and these instructions then save as metadata to the platform.
● End User Action: When the user event executes an apex code, the platform server gets the
compiled instructions from metadata and runs them through the apex interpreter before returning
the result.
Output:
ALL CODE AND DESCRIPTION IS IN BELOW LINK:
clound-computing-practicals.pdf
Conclusion:
Thus, We have created an Application in SalesForce.com using Apex programming Language.
Assignment No 4:
Aim/Title: Design and develop custom Application (Mini Project) using Sales force
Cloud.
Objective:
• To learn salesforce cloud administration.
• To install and configure the salesforce cloud administrative features.
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Intellij
Theory:
Salesforce is the primary enterprise offering within the Salesforce platform. It provides
companies with an interface for case management and task management, and a system for
automatically routing and escalating important events. The Salesforce customer portal provides
customers the ability to track their own cases, includes a social networking plug-in that enables
the user to join the conversation about their company on social networking websites, provides
analytical tools and other services including email alert, Google search, and access to customers'
entitlement and contracts.
Lightning Platform
Lightning Platform (also known as Force.com) is a platform as a service (PaaS) that allows
developers to create add-on applications that integrate into the main Salesforce.com
application.These third-party applications are hosted on Salesforce.com's infrastructure.
Force.com applications are built using declarative tools, backed by Lightning and Apex (a
proprietary Java-like programming language for Force.com) and Lightning and Visual force (a
framework that includes an XML syntax typically used to generate HTML).
Community Cloud
Community Cloud provides Salesforce customers the ability to create online web properties for
external collaboration, customer service, channel sales, and other custom portals I their instance
of Salesforce. Tightly integrated to Sales Cloud, Service Cloud, and App Cloud, Community
Cloud can be quickly customized to provide a wide variety of web properties Salesforce Sales
Cloud Salesforce Sales Cloud is a customer relationship management (CRM) platform designed
to support sales, marketing and customer support in both business-to-business (B2B) and business-
to-customer (B2C) contexts.
1. From Setup, enter Apps in the Quick Find box, then select Apps.
2. Click New.
3. If the Salesforce console is available, select whether you want to define a custom app or a
Salesforce console.
4. Give the app a name and description. An app name can have a maximum of 40 characters,
including spaces.
5. Optionally, brand your app by giving it a custom logo.
6. Select which items to include in the app.
7. Optionally, set the default landing tab for your new app using the Default Landing
Tab drop-down menu below the list of selected tabs. This determines the first tab a user
sees when logging into this app.
8. Choose which profiles the app will be visible to.
9. Check the Default box to set the app as that profile’s default app, meaning that new users
with the profile see this app the first time they log in. Profiles with limits are excluded
from this list.
10. Click Save
Output:
Conclusion:
Thus, We have designed and developed custom application using salesforce cloud.
Assignment No 5:
Mini-Project
Aim/Title: Setup your own cloud for Software as a Service (SaaS) over the existing
LAN in your laboratory. In this assignment you have to write your own code for a
cloud controller using open source technologies to implement with HDFS.
Implementing the basic operations may be like to divide the file in segments/blocks
and upload/ download file on/from cloud in encrypted form.
Objective:
To set your own cloud for SaaS over existing LAN
To implement the basic operations may be like to divide the file in segments/blocks
Requirements:
Hardware Requirement:
Object: PC, Laptop
Software Requirement:
Operating System: Windows 7,8,10/11
Specification: Core i3,i5 or above
Specified Language : C++, Java, Python
Software: Visual Studio Code, Intellij
Theory:
Output:
Conclusion: