Skip to content

Add co-calling graph #5

@dgleich

Description

@dgleich

Given a large corpus of computer programs, create a graph / hypergraph where functions are linked if they are called within the same function.

e.g.

function nngraph(idxs::Matrix{Int32})
  n = size(idxs, 2)
  ei = zeros(Int,0)
  ej = copy(ei)
  for i=1:n
    for k=1:size(idxs,1)
      push!(ei, i)
      push!(ej, idxs[k,i])
    end
  end
  A = sparse(ei,ej,1.0,n,n)
  return max.(A,A')
end

This would create edges / hyperedges among

size, zeros, copy, push!, sparse, max.

An ideal corpus would be the set of Julia packages...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions