How to pass a set or unnamed relation into a PostgreSQL function?
You could define a record type that represents one tuple of what you want to pass, then pass an array of that type:

create type path_info
(
  id  integer, 
  source integer,
  target integer, 
  cost float
);


Then pass an array to your function:

select *
from shortest_path((select array_agg( (gid,start_id,end_id,shape_leng)::path_info ) 
                    from network), 
                   ...);


The function parameter needs to be defined as path_info[]: 

create function shortest_path(p_path_info path_info[], ...)
  returns ...
as
...




Depending on what you are doing with those values, a function that receives a single record used with a lateral join might be more efficient:

Something like:

select *
from network n
  join lateral shortest_path( (n.gid, n.start_id, n.end_id, n.shape_leng)::path_info, ...) on ....