Skip to content

Instantly share code, notes, and snippets.

View sanskarfc's full-sized avatar
👋
yo

Sanskar Sharma sanskarfc

👋
yo
View GitHub Profile
@sanskarfc
sanskarfc / prd1.md
Created May 17, 2025 18:12
basic llm calls with qna - prd1

Basic LLM Calls with QnA

The user will enter the data structures and algorithms doubt they have in the text box and press enter

image.png

This question will then be sent to openai and we extract a structured output from openai. Let’s think about the structured output we want.

Miscellaneous things we want to add:

# Trivially perfect graphs are the graphs that do not have a P4 path graph or a C4 cycle graph as induced subgraphs.
# Reference: Brandstädt, Le & Spinrad (1999), theorem 6.6.1, p. 99; Golumbic (1978), theorem 2. Wolk (1962) and Wolk (1965) proved this for comparability graphs of rooted forests.
# Error: By mistake used DiGraphs here instead of undirected.
# returns true if C4 is present
def checkC4(graph):
for vertex in graph:
if(graph.degree(vertex) != 2):
return False
# Function to find all minimal separators of a graph
def find_minimal_separators(G):
separators = []
visited_separators = {}
# Initial iteration
for v in G.vertices():
N_v = set(G.neighbors(v))
S = N_v.union({v})
G_S = G.copy()