Skip to content

Instantly share code, notes, and snippets.

View abalter's full-sized avatar

Ariel Balter abalter

  • Center For Health Systems Effectiveness, OHSU
  • Portland, OR
View GitHub Profile

Am I correct that any square matrix can be thought of as a directed graph? If so, how do I determine whether or not it contains cycles? Is it by looking for imaginary eigenvalues?

Yes, any square matrix can be thought of as a directed graph, particularly when you interpret the matrix as an adjacency matrix of the graph. Here's how this works and how you can determine whether the graph contains cycles:

Interpreting a Square Matrix as a Directed Graph

  1. Adjacency Matrix: A square matrix ( A ) of size ( n \times n ) can represent a directed graph with ( n ) vertices. The entry ( A[i][j] ) indicates the presence (and possibly the weight) of a directed edge from vertex ( i ) to vertex ( j ).

Determining the Presence of Cycles

Ariel Balter Obsidian

Key Uses

  • To-Do lists
  • Track multiple projects
  • Maintain lists (such as materials needed for projects, information needed, etc.)
  • Calendar
  • Personal notes
  • Research notes
  • Research ideas
@abalter
abalter / adding-items-to-selected-stacks.markdown
Created November 9, 2022 06:04
Adding items to selected stacks
@abalter
abalter / simple-codepen-example.html
Created November 3, 2022 05:30
Simple two-tab codepen example in a single html file. Based on https://codepen.io/Souleste/pen/xxwvVva
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - Simple CodeMirror Sample</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/codemirror.css'>
<style>
.tabs {
list-style-type: none;
padding: 0;
@abalter
abalter / index.html
Created November 3, 2022 05:16
Simple CodeMirror Sample
<div class="tabs-container">
<ul class="tabs">
<li class="tab active" data-tab="0">One</li>
<li class="tab" data-tab="1">Two</li>
</ul>
<div class="tab-pane active" data-pane="0">
<textarea class="editor">// here is the first one
var editor = CodeMirror.fromTextArea(document.getElementById('editor'), {
mode: "javascript",
lineNumbers: true,
@abalter
abalter / screen-and-tmux.md
Created May 19, 2022 23:04
Screen and Tmux tutorial

Terminal Multiplexers

A terminal multiplexer mainly facilitates three things:

  1. Create persistent terminal sessions that remain intact even when you log out of a machine--as long as the machine itself remains running. For example:
  • SSH into a remote machine
  • Start a screen session
  • Start a process
  • Log out of the machine
  • Log back in later, attach to the screen session, and continue working with that process.
@abalter
abalter / datatables-editor-template.markdown
Created May 8, 2022 05:16
datatables editor template
@abalter
abalter / matlab_to_r_transpilers.md
Created April 3, 2022 22:12
List of tools to transpile matlab to R
.ipynb_checkpoints
@abalter
abalter / test_xlsx.xlsx
Last active December 24, 2019 21:46
Strange xlsx for stackoverflow question