Computational Thinking Project Notes
Computational Thinking Project Notes
Most intractable problems have an algorithm to solve them (the same algorithm) which is the
brute force algorithm. The reason there is no efficient algorithm for these problems is that
they are so close to random. [source]
Backtracking:
● Descriptions have formal semantics that allow both people and computers to
process them in an efficient and unambiguous manner;
● Entity descriptions contribute to one another, forming a network, where each
entity represents part of the description of the entities, related to it, and
provides context for their interpretation.
the real power of knowledge graphs comes when we transform our own data into
RDF triples and then connect our proprietary knowledge to open global knowledge.
https://www.ontotext.com/knowledgehub/fundamentals/what-is-a-knowledge-
graph/
What is RDF?
RDF is a standard for data interchange that is used for representing highly
interconnected data. Each RDF statement is a three-part structure consisting of
resources where every resource is identified by a URI. Representing data in RDF
allows information to be easily identified, disambiguated and interconnected by AI
systems.
https://www.ontotext.com/knowledgehub/fundamentals/what-is-rdf/
What is a triple?
How to find the max value path?
https://stackoverflow.com/questions/15559950/tree-graph-traversal-find-maximum-
value-path
https://www.techiedelight.com/maximum-cost-path-graph-source-destination/- has
code
https://www.khanacademy.org/computing/computer-science/algorithms/breadth-
first-search/a/the-breadth-first-search-algorithm
Using UCS:
Dijkstra's algorithm searches for shortest paths from root to every other node in a graph,
whereas uniform-cost searches for shortest paths in terms of cost to a goal node.
https://www.youtube.com/watch?v=dRMvK76xQJI
https://www.youtube.com/watch?v=-FY7t2kqWX4
https://www.youtube.com/watch?v=Z7_A3Ih-VjY
Using A*:
Resources
Youtube tutorials- Gerry Jenkins
Textbook resource! (easy to digest chapters)
8 Time Complexities
Notes- graphs
Use adjacency list instead of adjacency matrix for sparse graphs
Adjacency matrices:
Index to look up a row is the from vertex
Index for the column is the to vertex
For vertices with connections, the weight is stored in the cell of the intersection
Undirected graphs need two entries for every edge
Adjacency lists:
you have a vertex object containing info about the vertex (its ID) along with a dictionary of
edges to other vertices
Undirected vs directed graphs: for undirected graphs, you need two entries for each
connection
Polynomial algorithm
Exponential algorithm
Hard to solve in a computational complexity sense-can run for a really long time
Therefore, we often use a greedy algorithm to find a solution that is good enough rather than
the optimal solution
Heuristic techniques
- Makes a series of decisions in sequential steps
- At every step, make the best decision for the current step
- Local decision do not guarantee best global solution
Greedy algo: construct the step by step solution, only optimize one step at a time; maximize
for short term gain
Local search algo: start with a feasible solution; at every step, make a small modification to
the solution
Questions:
What were the tricks used to limit the paths (the e.g. about visiting many cities in the US)
Heuristic techniques
1st greedy algo for TSP
Pseudocode:
Let S be the set of cities; T- initial tour of one city picked randomly
Remove this first city from from S
While there are still cities in S:
Find the city x in S with the smallest distance to the last selected city & remove x from S
When there are 3 items, it doesn’t matter which option you pick (because they are just
different versions of the same path)