03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& •...

16
9/3/14 1 Graph Visualiza2on I Today MiniPresenta2ons from HW #1 Rebecca, Altan, Jaron, Jesse Some Graph Terminology A graph problem from materials research

Transcript of 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& •...

Page 1: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

1  

Graph  Visualiza2on  I  

Today  

•  Mini-­‐Presenta2ons  from  HW  #1  – Rebecca,  Altan,  Jaron,  Jesse  

•  Some  Graph  Terminology  

•  A  graph  problem  from  materials  research  

Page 2: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

2  

hLp://madang.ajou.ac.kr/~kwlee/images/theMBTImap_actual%20poster%20image.pdf  

hLp://www.chartball.com/img/BOS2011eSize.gif  

Page 3: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

3  

IOGraphica  hLp://iographica.com  

Stefaner,  Moritz.  "Cita2on  PaLerns."  Wellformed  Eigenfactor.  N.p.,  2008.  Web.  

Page 4: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

4  

Jus2n  J.  (from  Spring  ‘12)  

Benjamin  B.  (from  Spring  ‘12)  

Page 5: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

5  

How  to  best  use  LMS?  •  How  to  embed  image  in  your  post?  

–  This  fails  for  some  students,  why?    What  are  the  successful  students  doing?    Create  a  medium  resolu2on  version  of  image  for  embedding?  

•  How  to  make  URL  links?    Please  use  links  for  sharing  publicly-­‐available  documents  

•  How  to  aLach  a  document  –  Please  don’t  use  Word…    Google  docs  refuses  to  display  (bandwidth  limit),  

must  save  &  open  separately.    Time  consuming.  –  .pdf  seems  to  load  in  browser,  quite  fast  –  A  shared  Google  Doc  was  the  fastest?  –  But  if  it’s  just  text,  please  post  as  a  simple  comment  rather  than  upload  

•  I’ll  get  the  HW  submission  server  up  later  this  week.  The  idea  is:  –  post  something  to  share  with  your  classmates  on  LMS,  in  a  fast  &  easy  to  

read  format  (more  likely  to  look  at  before  class  &  get  feedback  online)  –  Upload  the  complete  assignment  to  the  homework  server,  including  the  

README.txt,  so  that  I  can  grade  it  

Today  

•  Mini-­‐Presenta2ons  from  HW  #1  •  Some  Graph  Terminology  

•  A  graph  problem  from  materials  research  

Page 6: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

6  

Graph  Terminology  I  •  Tree  –  no  cycles  •  Directed  /  Undirected    Edges  •  Cycle  –  A  path  along  edges  through  the  graph  star2ng  &  ending  

at  the  same  vertex.    Variants:  closed  walk,  simple  cycle,  directed  cycle,  …  

•  Valence  (a.k.a.  Degree)  of  a  Vertex  -­‐  #  of  edges  incident  on  the  vertex  

•  Regular  –  Each  vertex  has  same  valence,  a  3-­‐regular  graph  is  also  called  cubic  

•  Polygon  –  2D  flat  or  on  a  sphere,  with  straight  or  great  circle  edges  Polyhedron  –  3D  solid  formed  by  flat  faces  Polytope  –  flat  sides  in  any  dimension  

•  BiPar2te  –  ver2ces  can  be  split  into  two  groups,  A  &  B.    No  edge  connects  a  vertex  in  A  to  another  vertex  in  A.    Same  for  B.  

Graph  Terminology  II  •  Clique  –  subset  of  ver2ces  in  an  undirected  graph  with  an  edge  connec2ng  every  pair  of  ver2ces  in  the  subset.  

•  Upward  Drawing  (of  a  tree)  –  no  child  is  drawn  with  ver2cally  above  (higher  y  value)  its  parent.    

•  Plane  Graph  –  A  2D  drawing  of  the  graph  where  no  edges  cross  (touching  at  the  endpoint  ver2ces  they  share  is  ok)      

•  Planar  Graph  –  A  graph  for  which  a  Plane  Graph  exists.  

•  Euler’s  Theorem  for  planar  graphs.    For  a  plane  graph  with  n  ver2ces,  m  edges  and  f  faces,  we  have  n  −  m  +  f  =  2.    

Page 7: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

7  

"Graph  drawing  by  force-­‐directed  placement",  Fruchterman  &  Reingold,  1991  

String/Cloth  Simula2on  

•  Springs  link  the  par2cles  •  Springs  try  to  keep  their  rest  lengths  and  preserve  the  length  of  the  string  

Interac6ve  Anima6on  of    Structured  Deformable  Objects  Desbrun,  Schröder,  &  Barr  1999  

Page 8: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

8  

Spring  Forces  

•  Force  in  the  direc2on  of  the  spring  and  propor2onal  to  difference  with  rest  length  L0  

•  K  is  the  s2ffness  of  the  spring  – When  K  gets  bigger,  the  spring  really  wants  to  keep  its  rest  length  

Pi   Pj  

L0   F  

Reading  for  Thursday  @  11:59pm  

•  “Force  Directed  Graph  Drawing”  chapter  by  Steven  Kobourov  from  the  book  Handbook  of  Graph  Drawing  and  Visualiza6on  2013  

Page 9: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

9  

Today  

•  Mini-­‐Presenta2ons  from  HW  #1  •  Some  Graph  Terminology  

•  A  graph  problem  from  materials  research  

Enumera2ng  Non-­‐Planar  Foam  Polyhedra  

Page 10: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

10  

Enumera2ng  Non-­‐Planar  Foam  Polyhedra  

•  3-­‐regular  (cubic)  connected  planar  graph  

Enumera2ng  Non-­‐Planar  Foam  Polyhedra  

•  Definitely  non-­‐planar….  

Page 11: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

11  

Enumera2ng  Non-­‐Planar  Foam  Polyhedra  

•  Edges  must  be  curved  too…  

Star2ng  Configura2on  

•  Each  vertex  has  “receptors”  for    3  edge  links  

•  ADD  AN  EDGE    between  1  &  2  

•  All  other  ver2ces    are  unlinked  and    their  rela2ve    posi2ons  are    unspecified  

Page 12: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

12  

Random  Graph  Genera2on  

•  Pick  2  ver2ces  at  random  that  each    have  >=  1  open    receptor  

Random  Graph  Genera2on  

•  If  one  vertex  was    already  linked  in    the  graph  &  the    other  was  not  linked,  

•  ADD  THE  EDGE  •  (If  >  1  receptor  is    open  at  a  vertex,    choose  randomly    from  the  open    receptors)  

Page 13: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

13  

Random  Graph  Genera2on  

•  If  neither  vertex    is  in  the  graph  yet,  

•  SKIP  THIS  PAIR  •  (It  may  be  selected    and  successfully    added  later)  

Random  Graph  Genera2on  

•  (Ayer  adding    a  couple  more    edges)  

Page 14: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

14  

Random  Graph  Genera2on  •  If  both  ver2ces  are    

in  the  graph,  check    for  an  edge  crossing:  

•  If  the  open  receptors    are  not  adjacent  in  a  traversal  of  the  open    receptors  on  the    border  of  the  graph,    

•  SKIP  THIS  PAIR  •  (This  pair  may  be    

selected  and    successfully  added  later)  

Random  Graph  Genera2on  

•  (Ayer  adding  a  few  more  edges)  

Page 15: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

15  

Random  Graph  Genera2on  

•  If  both  selected  ver2ces    are  already  in  the  graph,    and  the  open    receptors  for  each    vertex  are  adjacent,  

•  ADD  THIS  EDGE  •  (BTW,  you  have  just    created  a  polygonal  face!)    

Random  Graph  Genera2on  

•  (Ayer  adding    the  final  edges  and  faces)  

Page 16: 03 graphs 1 - Computer Science at RPI · 9/3/14 1 Graph&Visualizaon&I Today& • Mini:Presentaons&from&HW&#1& – Rebecca,&Altan,Jaron,Jesse& • Some&Graph&Terminology& • A&graph&problem&from&materials

9/3/14  

16  

Finished  Graph  

•  Will  all  unique  graphs  with  n    nodes  eventually  be  generated  by  this  algorithm?  

•  What  is  the  probability  for  genera2ng  a  specific  graph?  

•  Anecdotally,  it  took  an    unreasonably  lengthy  search    to  generate  the  dodecahedron    (regular  12  sided  polytope)  

•  What  other  approaches  are  possible?  

Homework  Assignment  2:  due  Monday  @  11:59pm  New  (to  you)  Graph  Visualiza2on  Tools  •  Find  a  Graph  Visualiza2on  Tool  you  have  not  used  (or  have  not  explored  its  graph  visualiza2on  func2onality)  –  Some  possibili2es:  VTK,  D3,  GraphVis,  Processing,  ?  – Make  a  variety  of  synthe2c  graph  datasets  (a  tree,  a  clique,  a  planar  graph,  bipar2te  graph,  etc.)  of  medium  size  (a  “good,  ~op2mal”  layout  could  be  done  by  hand)  and  throw  them  into  this  tool  &  try  different  se{ngs.  

–  Take  a  bunch  of  screenshots  and  do  a  short  writeup  analyzing  the  quality  of  the  results.    Note  weaknesses  or  degeneracies  .Could  you  have  done  beLer  by  hand?  

•  Focus:  Visualiza2on  Execu2on  &  Data  Synthesis