PAMI.subgraphMining.topK package

Submodules

PAMI.subgraphMining.topK.DFSCode module

class PAMI.subgraphMining.topK.DFSCode.DfsCode[source]

Bases: object

add(ee)[source]
containEdge(v1, v2)[source]
copy()[source]
getAllVLabels()[source]
getAt(index)[source]
getEeList()[source]
getRightMost()[source]
getRightMostPath()[source]
isEmpty()[source]
notPreOfRm(v)[source]
onRightMostPath(v)[source]

PAMI.subgraphMining.topK.DFSThread module

class PAMI.subgraphMining.topK.DFSThread.DfsThread(graphDb, candidates, minSup, tkgInstance)[source]

Bases: Thread

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

PAMI.subgraphMining.topK.abstract module

PAMI.subgraphMining.topK.edge module

class PAMI.subgraphMining.topK.edge.Edge(v1, v2, edgeLabel)[source]

Bases: object

another(v)[source]
getEdgeLabel()[source]

PAMI.subgraphMining.topK.extendedEdge module

class PAMI.subgraphMining.topK.extendedEdge.ExtendedEdge(v1, v2, vLabel1, vLabel2, edgeLabel)[source]

Bases: object

getEdgeLabel()[source]
getV1()[source]
getV2()[source]
getVLabel1()[source]
getVLabel2()[source]
pairSmallerThan(x1, x2, y1, y2)[source]
smallerThan(that)[source]
smallerThanOriginal(that)[source]

PAMI.subgraphMining.topK.frequentSubgraph module

class PAMI.subgraphMining.topK.frequentSubgraph.FrequentSubgraph(dfsCode, setOfGraphsIds, support)[source]

Bases: object

PAMI.subgraphMining.topK.graph module

class PAMI.subgraphMining.topK.graph.Graph(id, vMap=None, dfsCode=None)[source]

Bases: object

EMPTY_INTEGER_ARRAY = []
EMPTY_VERTEX_LIST = []
findAllWithLabel(targetLabel)[source]
getAllNeighbors(v)[source]
getAllVertices()[source]
getEdge(v1, v2)[source]
getEdgeCount()[source]
getEdgeLabel(v1, v2)[source]
getId()[source]
getNonPrecalculatedAllVertices()[source]
getVLabel(v)[source]
isNeighboring(v1, v2)[source]
precalculateLabelsToVertices()[source]
precalculateVertexList()[source]
precalculateVertexNeighbors()[source]
removeInfrequentLabel(label)[source]

PAMI.subgraphMining.topK.sparseTriangularMatrix module

class PAMI.subgraphMining.topK.sparseTriangularMatrix.SparseTriangularMatrix[source]

Bases: object

getSupportForItems(i, j)[source]
incrementCount(i, j)[source]
removeInfrequentEntriesFromMatrix(minsup)[source]
setSupport(i, j, support)[source]

PAMI.subgraphMining.topK.tkg module

class PAMI.subgraphMining.topK.tkg.TKG(iFile, k, maxNumberOfEdges=inf, outputSingleVertices=True, outputGraphIds=False)[source]

Bases: _TKG

EDGE_COUNT_PRUNING = True
ELIMINATE_INFREQUENT_EDGE_LABELS = True
ELIMINATE_INFREQUENT_VERTEX_PAIRS = True
ELIMINATE_INFREQUENT_VERTICES = True
class Pair(x, y)[source]

Bases: object

findAllOnlyOneVertex(graphDB, outputFrequentVertices)[source]
gSpan(graphDB, outputFrequentVertices)[source]

The main gSpan function to find frequent subgraphs. :param graphDb: The database of graphs to mine. :param outputFrequentVertices: Boolean indicating whether to output single vertices as subgraphs.

getKSubgraphs()[source]
getMemoryRSS()[source]
getMemoryUSS()[source]
getMinSupport()[source]
getQueueSize(queue)[source]
getRuntime()[source]
getSubgraphs()[source]

Creates a copy of the queue’s contents without emptying the original queue.

gspanDfs(c: DfsCode, graphDB, subgraphId)[source]
gspanDynamicDFS(c, graphDB, graphIds)[source]
isCanonical(c: DfsCode)[source]
readGraphs(path)[source]

The readGraphs function reads graph data from a file and constructs a list of graphs with vertices and edges.

Parameters:

path – This method reads the graph data from the specified file and constructs a list of graphs

represented by vertices and edges :return: The readGraphs method returns a list of _ab.Graph objects, which represent graphs read from the file.

registerAsCandidate(subgraph)[source]
removeInfrequentVertexPairs(graphDB)[source]
rightMostPathExtensions(c, graphDB, graphIds)[source]
rightMostPathExtensionsFromSingle(c, g)[source]
save(oFile)[source]

The save function writes subgraph information to a file in a specific format.

Parameters:

oFile – The oFile parameter in the save method is the file path where the output will be

saved. This method writes the subgraphs information to the specified file in a specific format

savePattern(subgraph)[source]
startMine()[source]

This Python function starts a mining process on a graph database, calculates runtime, pattern count, and memory usage metrics.

startThreads(graphDB, candidates, minSup)[source]
subgraphIsomorphisms(c, g)[source]

PAMI.subgraphMining.topK.vertex module

class PAMI.subgraphMining.topK.vertex.Vertex(id, vLabel)[source]

Bases: object

addEdge(edge)[source]
getEdgeList()[source]
getId()[source]
getLabel()[source]
removeEdge(edgeToRemove)[source]

Module contents