Movie Recommendation System
Movie Recommendation System
Algorithms
Mritunjay Jha 11906046, Rizul Sharma 11910306 Krishna Bhabat 11916423
School of Computer Science and Engineering
Lovely Professional University
Comparison Table:
Graph- Zahra Elsevier Autoencode Relation between
based Zamanza r and Hybrid users based on
hybrid deh recommend their similarities
recommend Darban, ation as nodes in a
ation system Mohamm similarity graph
with ad Hadi and combining
application Valipour them with the
to movie users’ side
recommend information to
ation solve the cold-
start issue.
producer
digital library using Hopfield net algorithm. This work person 2
genre 1
movie 3
recommending items.
Research on media content recommendations frequently
person 1 genre 2
has trouble determining how similar different products are
to one another. (in content-based). Authors frequently
Figure 1. Example of the data model represented in graph structure.
suggest changes to collaborative filtering. Neural networks
were employed by Biancalana et al. [7] to train the model
which ought to be suggested. This data model structure also
just once. As a result, their data's multidimensionality was
makes it possible for us to easily identify entities that are
actually reduced, yet they were unable to offer timely
comparable to other entities. This resemblance is implicitly
recommendations without retraining the algorithm.
stored in the connections between nodes.
Chen et al.'s work on the use of graph algorithms is also
interesting[8]. In the video search, they employed a IV. RECOMMENDATION ALGORITHMS
tripartite network of users, objects, and inquiries. In terms We use graph algorithms for our recommendation
of graph-based suggesting, this approach is extremely systems, which start at the beginning of the graph and go
similar to spreading activation, which shows promise. outward. Users' interests are represented by the initial
Bogers et al. [9] also offered a similar strategy. They nodes. A user's favourite movie or genre could serve as the
employed additional contextual characteristics in their starting node. These initial nodes are either directly chosen
work. (genre, language, director, actor, etc.). They by the user as a query or implicitly chosen based on both
employed a probabilistic approach that makes use of a the user model and the user's input using conventional
matrix containing the intensity of transitions between items techniques. In reality, connecting user models to nodes is
as the user browses through them. not necessary. We only need the list of items that the user
will find relevant, and we can utilise it as a query as we go.
III. REPRESENTATION OF MOVIES AND METADATA
The algorithms search the graph for the nodes that are
We created a network structure that represents the data—
closest to all beginning nodes, and these nodes are
information about media content—to produce precise
subsequently returned as suggestions. Finding the closest
suggestions. Our suggested structure is based on the RDF1
nodes can be approached from a variety of angles,
triplet structure and was influenced by how people actually
particularly in extremely complex graphs. For this reason,
speak or write about movies in everyday life.
we developed and tested four different algorithms.
The primary components are collectively referred to as
These settings allow the recommendation algorithms to
"movies," "TV shows," and "TV programmes." These are
be fairly flexible. For instance, the same algorithm can be
the things that should be suggested. People (actors,
used with different parameters to only propose TV shows
directors) and genres are examples of other entities. The
that will air tomorrow night or movies that are presently
graph's nodes serve as these representations. The
playing in theatres.
relationships between the entities are represented by the
edges between nodes, which operate as the at-tributes of
A. Union Colors Algorithm
the movies. Since the final network only has one
component (connected graph), all movies must be The Union Colors algorithm is based on the basic
indirectly connected to one another. The attributes make Breadth-first search (BFS) graph algorithm. The algorithm
sure that the model is connected and sophisticated by using works in the following way:
real data. Every movie, for instance, is linked to several 1) Mark each initial node with a different color (naturally,
different genres. We assume the graph is one component as colors are represented by numbers).
there are roughly 40 genres and 165 thousand nodes in 2) Perform a simultaneous BFS from each initial node:
total. Figure 1 depicts a sample of the data model graph a) Enqueue all initial nodes.
structure mentioned earlier. b) Dequeue a node and visit it.
When developing the concept, we presupposed that viewers c) Add all neighbors of the visited which are yet
also select the actors or directors of the films they watch. to be visited node into the queue.
Our method makes it straightforward to identify this pattern d) Repeat from step b)
and identify the entities because of the model's structure.
3) When a node is visited:
C1: recommended movie 1 C1: recommended movie 2 C1-C2: recommended movie 3 d) Try to add all neighbors of the visited node into
the queue.
i) If the node is not in the queue, add it and
remember, that it was added by the visited
node.
C1: person 1
ii) If the node is already in the queue, do not
C1-C2:
C1: genre 1
person 2
add it but remember that it has also been
added by the visited node.
e) Repeat from step b)
3) Continue until the required number of nodes is
colored by every color, return them.
C1: initial movie 1 C2: initial movie 2
In Figure 3 the visualization of the algorithm is illustrated.
The numbers in parentheses represent the colors of each
node after one iteration of the algorithm.
Figure 2. Visualization of Union Colors algorithm.
C. Energy Spreading Algorithm
The Energy Spreading algorithm is based on Spreading
a) If it is yet to be colored, color it with the color activation, which is a method for searching associative
of the initial node networks, neural networks, or semantic networks. Similar
b) If it is already colored (with a different color), to previous algorithms, it is a variation on the simultaneous
merge the two colors into one - remember that BFS algorithm. The logic of the algorithm is following:
one color equals the other 1) Set the energy of each initial node to some constant
4) Keep merging colors until the last two colors are value.
merged and only one color remains 2) Perform a simultaneous BFS from each initial node
5) Return the current and the next required number of (as described in the previous section).
nodes in the queue as the result 3) When a node is visited its energy increases by value
E, E = En , where Ep is the energy of the parent node
p
To merge the colors we can make use of the extremely fast
Disjoint-set data structure, using which two colors can be which enqueued the visited node and n is the number
merged in nearly constant time [10]. We actually do not need of nodes the parent node enqueued.
to traverse the whole graph. We only need to merge initial 4) A node’s energy can increase multiple times, but it
colors which count reflects the number of initial nodes. only spreads it when it receives energy for the first
Visualization of this algorithm is shown in Figure 2. time.
Nodes which have the final color are going to be recom- 5) Continue until the required number of nodes is
mended. These are the nodes which come out as output visited from each initial node.
of this algorithm. It actually means that nodes which are 6) Order the nodes by their energies and return the re-
colored with final color earlier are going to be quired number of the nodes, the more energy it has
recommended as more relevant. C1 and C2 are the colors the higher it is.
of initial nodes and the algorithm is stopped when it
reaches the node ”recommended movie 3”. movie 3 (-)(-)(-) movie 4 (-)(-)(-) recommended movie 1
(-)(-)(2,1)
2 2
3,33
3,33 3,33 10
2 4
2 person 2 (-)(-)(x) 4 4 2 movie 2
(3)(2)(5)
genre 1
(energy = 10) person 2 4 2
2
(energy = 10)
person 1 initial
(energy= 4) initial person 1 (1)(0)(x)
movie 1 4genre 1
(4)(5)(9) (0)(1)(x) 1
4 4 6
6
4
Figure 5. Visualization of Modified Dijkstra’s algorithm.
initial movie 1 Initial movie 2
(energy = 12) (energy = 12)