Code covered by the BSD License  

Highlights from
Submodular Function Optimization

image thumbnail

Submodular Function Optimization

by

 

28 Jun 2008 (Updated )

This toolbox provides functions for maximizing and minimizing submodular set functions.

sfo_plot_subgraph(coords,edges,steinernodes)
% Plots a subgraph on known coordinates
% author: Andreas Krause (krausea@gmail.com)
%
% function sfo_plot_subgraph(coords,edges,steinernodes)
% plots a placement generated by the computePlacement function.
% Red squares are the selected nodes, rest are support (communication)
% nodes
%
% Example: See sfo_tutorial.m

function sfo_plot_subgraph(coords,edges,steinernodes)
plot(coords(:,1),coords(:,2),'.');
allnodes = sfo_unique_fast(edges(:));
hold on
plot(coords(allnodes,1),coords(allnodes,2),'o');
selnodes = sfo_setdiff_fast(allnodes,steinernodes);
plot(coords(selnodes,1),coords(selnodes,2),'rs');

for i = 1:size(edges,1)
    line([coords(edges(i,1),1),coords(edges(i,2),1)],[coords(edges(i,1),2),coords(edges(i,2),2)]);
end
hold off

Contact us