0% found this document useful (0 votes)
8 views14 pages

19MAM81-GRLmidsem 1 Answer Key

The document outlines the structure and content of the Mid Semester Exam for the course 'Graph Representation Learning' at Coimbatore Institute of Technology. It includes course outcomes, topics covered, and a series of questions divided into two parts, focusing on key concepts in graph theory and representation learning. The exam is scheduled for February 17, 2025, and consists of both short answer and detailed explanation questions.

Uploaded by

MNBVCXZ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views14 pages

19MAM81-GRLmidsem 1 Answer Key

The document outlines the structure and content of the Mid Semester Exam for the course 'Graph Representation Learning' at Coimbatore Institute of Technology. It includes course outcomes, topics covered, and a series of questions divided into two parts, focusing on key concepts in graph theory and representation learning. The exam is scheduled for February 17, 2025, and consists of both short answer and detailed explanation questions.

Uploaded by

MNBVCXZ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

COIMBATORE INSTITUTE OF TECHNOLOGY: COIMBATORE-641 014.

(Government Aided Autonomous Institution)

DEPARTMENT OF COMPUTING – AI & ML


19MAM81 – Graph Representation Learning
IV Year M.Sc. (AI & ML) – VIII Semester
Course Faculty: Dr. D. Kavitha
I Mid Semester Exam
Date: 17.02.2025 Time: 9.00 am to 11.00 am
Max. Marks: 60

Course Outcomes Covered:

CO1 : Understand the fundamental concepts of graph theory.

CO2 : Familiarize with the different graph reconstruction methods.

Portions Covered: Unit 1, 2

Note: 1. Answer ALL questions in PART A & PART B

Q.NO PART - A (10 x 2 Marks = 20 Marks) MARKS COs BT


1 Define adjacency matrix with example.

An adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix
indicate whether pairs of vertices are adjacent (connected) or not in the graph.

Definition

For a graph with nnn vertices, the adjacency matrix AAA is an n×nn \times nn×n matrix where:

● A[i][j]=1A[i][j] = 1A[i][j]=1 if there is an edge between vertex iii and vertex jjj.
● A[i][j]=0A[i][j] = 0A[i][j]=0 if there is no edge between vertex iii and vertex jjj.

For weighted graphs, the matrix contains the weight of the edge instead of just 1s and 0s.

2 What is community detection?


Community detection is the graph equivalent of unsupervised clustering, where the goal is to
uncover latent community structures in a graph based on its nodes and edges.
Intuition: Real-world networks often exhibit community structures, where nodes within the same
group are more likely to form edges with each other than with nodes in other groups.
Example Scenario: A collaboration graph (e.g., from Google Scholar) would likely segregate into
clusters based on factors like research areas or institutions, rather than forming a uniform "hairball"
of connections.
Applications: Community detection is widely used in areas such as identifying functional modules in
genetic interaction networks and detecting fraudulent user groups in financial transaction networks.
Challenge: The task involves inferring community structures solely from the input graph
(𝐺=(𝑉,𝐸)G=(V,E)), without prior information about the node groupings or labels.

3 Compare betweenness centrality and closeness centrality.


Betweenness Centrality: Measures how often a node lies on the shortest path between two other
nodes.
Closeness Centrality: Measures the average shortest path length between a node and all other nodes.
4 Define motifs and graphlets.
Motifs (or graphlets) are small, recurring patterns or structures within a graph.
Examples include triangles, cycles of specific lengths, and other small subgraphs.
Generalization:
Beyond triangles, motifs can capture more complex structures in a node's ego graph.
This allows for richer characterization of a node's role or structural properties within the graph.
5 Mention any two disadvantages of node level statistics
Degree and eigenvector centrality are useful for identifying prominent nodes, such as the Medici
family in the Florentine marriage network.
However, they may not fully capture distinctions between other nodes with similar metrics (e.g.,
Peruzzi and Guadagni).
6 What is latent space representation?
Instead of working with an entire adjacency matrix (which is sparse and high-dimensional),
embeddings place nodes in a continuous vector space.
The relative distances between embeddings should reflect the relationships in the original graph (e.g.,
edges).
7 Define reconstruction loss function in encoder-decoder model.

The empirical reconstruction loss L is defined over a set of training node pairs D. Each pair (u,v)D consists
8 Bring out the differences between encoder and decoder.
Encoder - Converts a graph (nodes & edges) into a low-dimensional latent representation
(embeddings).
Decoder - Reconstructs the graph or performs tasks like link prediction using the latent
representations.
9 Differentiate between biased random walk and personalized random walk.
Biased Random Walks (e.g., GraRep) – Skips nodes to capture long-range dependencies.
Personalized Random Walks – Modify walk probabilities based on external attributes like edge
weights or node types.
10 Define uniform and filtered sampling.
Uniform Sampling

Definition:In uniform sampling, each node or edge in the graph has an equal probability of being
selected, regardless of its importance or characteristics.

Filtered Sampling

Definition:Filtered sampling selects nodes or edges based on specific criteria or constraints (such
as degree, centrality, importance, or label distribution).

PART – B (4 x 10 Marks = 40 Marks)


11 a) Explain multi-partite and multiplex graph with examples.
or
12 a) Demonstrate the role of eigenvector and random walk in finding
the neighborhood of nodes.

Eigenvector Centrality
•Definition:
•Accounts for the importance of a node's neighbors.
•A node’s centrality is proportional to the average centrality of its
neighbors.
where λ is a constant.

Eigenvector Equation: λe=Ae


•The centrality vector e is the eigenvector corresponding to the largest
eigenvalue of the adjacency matrix A, as per the Perron-Frobenius
Theorem.
Random Walk Interpretation
•Eigenvector centrality reflects the likelihood of a node being visited
during a random walk of infinite length.
•Using power iteration, the centrality values can be computed
iteratively: e(t+1)=Ae(t)
•Starting with e(0)=(1,1,…,1)T
• after the first iteration, e(1) contains node degrees.
•After many iterations, the values converge to the eigenvector
centrality.
•Application to Florentine Marriage Network
•The Medici family has the highest eigenvector centrality (normalized
value: 0.43), further emphasizing their influence.
•This value is higher than the next most influential family (normalized
value: 0.36).

b) Identify the process of neighborhood overlap detection in relation


prediction.
13 a) Differentiate between full graph and training graph.

Full Graph:
•Represents the entire network with all edges (both training and test edges).
•The solid blue edges are the training edges.
•The dashed red edges are the test edges that need to be predicted.
Training Graph:
•A subsampled version of the full graph, where the test edges (red dashed lines) have
been removed.
•This graph is used for training models or computing overlap statistics.

b) Paraphrase the terms:


1. Sorensen Index
Normalizes the overlap by the sum of the degrees of nodes 𝑢 and 𝑣.This prevents the
measure from being overly influenced by nodes with large degrees.

2. Salton Index
Normalizes using the product of the degrees.
Useful in balancing the influence of degrees in large, heterogeneous graphs. ((e.g.,
some nodes may have hundreds of neighbors, while others have only a few)

3. Jaccard Index
Considers both the shared and total neighbors of nodes 𝑢 and 𝑣.
A widely used metric for neighborhood similarity.

4. Adamic Adar Index


Similar to the RA index but uses the logarithm of degrees for weighting.
Captures the diminishing importance of high-degree neighbors more smoothly.

or
14 a) Explain Katz index and Leicht-Holme-Newman (LHN) Similarity.
. Katz Index
The Katz index computes the similarity between two nodes based on the count of paths of all
lengths between them, with shorter paths receiving higher weight

The LHN similarity normalizes the Katz index by accounting for the expected number of
paths under a random graph model. This reduces the bias toward high-degree nodes.

b) Find the unnormalized laplacian for the graph with edges {(2,3),(3,4),(4,5)}.
c)

d)
15 a) Explain shallow embedding approach with example.
Encoder:
The encoder's job is to transform each node in the graph into a low-dimensional vector
(embedding). This mapping is learned such that similar nodes in the graph should be
represented by similar vectors in the embedding space.

Shallow Embedding Approach:


In many methods, the encoder is a shallow function that simply looks up a pre-learned vector
for each node. This can be seen as a simple mapping from node IDs to embeddings.
Key Idea:
This method doesn't explicitly learn based on the graph structure but assumes that the
embeddings, once learned, capture the relevant information for the node. It's often seen in
basic node embedding methods like DeepWalk or Node2Vec.

b) Discuss the goal of pairwise decoder in detecting node relationships.


Purpose of the Decoder
Given a node embedding zu for a node u, the decoder attempts to predict certain
characteristics of the graph related to that node. These characteristics might include:

Pairwise Decoders
The most common type of decoder used in node embedding models is the pairwise decoder.
This decoder takes in a pair of node embeddings and predicts their relationship or similarity
based on the graph structure.

This means that the decoder receives two d-dimensional embeddings as input and outputs a
positive scalar value that represents the relationship between the two nodes.

or

16 a) How to optimize the encoder-decoder model with loss function?


To train an encoder-decoder model for node embeddings,
the key goal is to minimize a reconstruction loss that
measures how well the model can predict the relationships between pairs of nodes based on
their embeddings.
optimizing both the encoder and decoder
accurately reconstruct the graph's structure from the learned node embeddings.
Reconstruction Loss Function
The empirical reconstruction loss L is defined over a set of training node pairs D. Each pair (u,v)D

b) Demonstrate the role of laplacian eigenmaps in matrix factorization.


2. Laplacian Eigenmaps (LE)
One of the earliest factorization-based methods, Laplacian Eigenmaps, focuses on preserving
local graph structures.
The decoder function measures similarity using the squared L2 distance between node
embeddings:

The loss function ensures that similar nodes stay close in the embedding space:

If S is a Laplacian matrix, solving this loss function is equivalent to spectral clustering,


where the embeddings correspond to the smallest eigenvectors of the graph Laplacian.
Step 1: Construct the Adjacency Matrix A
Step 2: Compute the Degree Matrix D
The degree matrix D is a diagonal matrix where each diagonal entry D[i,i] is the sum of the
corresponding row in A:

Step 3: Compute the Laplacian Matrix L


The graph Laplacian is defined as:
Step 4: Compute the Eigenvalues and Eigenvectors of L
Laplacian Eigenmaps finds the smallest nonzero eigenvectors of L. These eigenvectors
provide a low-dimensional representation of the nodes.

Step 5: Interpretation
Each row of Z represents a 2D embedding for a node.
Similar nodes (e.g., A and C, B and D) have closer embeddings.
The embeddings preserve local graph structure by minimizing differences between connected
nodes.

17 a) Write short notes on the inner product decoder.


3. Inner-Product Based Methods
A more recent approach replaces L2 distance with an inner-product decoder

This assumes that node similarity (e.g., neighborhood overlap) is proportional to the dot
product of their embeddings.
Some methods using this approach:
Graph Factorization (GF): Uses the adjacency matrix (𝑆=𝐴S=A) as similarity.
GraRep: Uses powers of the adjacency matrix to capture long-range connections.
HOPE: Uses more general node similarity measures. The loss function minimizes the
difference between predicted and actual similarities
The loss function minimizes the difference between predicted and actual similarities
These methods can be solved using Singular Value Decomposition (SVD), reducing the
problem to matrix factorization:

b) Discuss on Large-scale Information Network Embeddings(LINE).


3. LINE (Large-scale Information Network Embeddings)
While DeepWalk and node2vec rely on random walks, LINE takes a different approach. It
defines node similarity based on first-order (direct connections) and second-order (two-hop
connections) proximity.
First-order Proximity:
Directly connected nodes should have similar embeddings.
Loss function minimizes difference between adjacency-based similarities

Second-order Proximity:Nodes with many common neighbors should have similar


embeddings.
Optimized using Kullback-Leibler divergence(KL)-
divergence to approximate second-order relationships.

or
18 a) How does reconstruction of multi-relational graph happen with loss function?
In a multi-relational graph, nodes are connected by different types of edges (relationships).
Imporatnt task is to embed these nodes into a low-dimensional space and reconstruct their
relationships.
Unlike simple graphs, where we only consider node pairs, multi-relational graphs require us
to consider edge types as well.
Decoder Function for Multi-Relational Graphs
The decoder function DEC(u, τ, v) computes the likelihood that an edge (u, v) of type τ
exists.
One early approach is RESCAL, which represents relationships using learnable matrices

b) Discuss in detail about multi-relational decoders.


Multi-relational decoders are used in knowledge graph embeddings to model relationships
between entities.
Various decoding functions exist, with the goal of balancing expressiveness and
computational efficiency.
Key Decoder Types:
RESCAL Decoder
Uses a trainable matrix for each relation:

Computationally expensive (O(d²) parameters per relation).


Translational Decoders (TransE, TransX)
Represents relations as translations in embedding space:

Efficient (O(d) parameters per relation).


Extensions like TransH project entities onto a hyperplane before translation.
Multi-Linear Dot Product Decoders (DistMult)
Generalizes dot product for three vectors

Efficient but only models symmetric relations.


**********************ALL THE BEST******************

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy